Starmer keen to avoid transgender rights fiasco that toppled Nicola Sturgeon