NSW risks running out of teachers: union