Police Scotland have been warned they face sleepwalking into a legal battle like the one engulfing the NHS by allowing trans staff to use whatever changing room they wish.