JK Rowling joined women's rights campaigners in calling for girls to be better protected in Scottish schools.