Analysis by party finds £22m was spent on bursaries for trainees who did not go on to take up teaching posts