Maesteg School confirmed it was locked down "due to a medical situation of a pupil and the need to protect the dignity of the young person involved"