N. Ireland 1st minister quits amid battle over Brexit checks