Deputies in California say a school security guard overheard the student threatening to shoot up his school