Method for testing an electronic circuit comprising a test mode secured by the use of a signature, and associated electronic circuit