Method of securing the test mode of an integrated circuit via intrusion detection