In the execution of a search warrant the person executing the same may reasonably detain and search any person in the place at the time:

(a) To protect himself from attack, or

(b) To prevent the disposal or concealment of any things particularly described in the warrant.