demandimport: fix issue579 and add a test
fix suggested by Brendan
*** failed to import extension badext: bit bucket overflowextension 'hgext.gpg' overrides commands: sigs sigcheck signhg help [COMMAND]show help for a command, extension, or list of commands