Sets/clears the motor protection flags. The function returns an error, if the privilege flag is not set.