School students in Aberdeenshire were kept indoors after reports of a man in the area with a sword.