Northern Ireland bill could be used to prevent next prime minister from proroguing parliament and initiating unruly EU exit