US state reaches deal to repeal transgender ‘bathroom law’