Cleanup sys.modules correctly in test_run.

We were leaving testtools.runexample behind which breaks test isolation.

Change-Id: I500c20317183596d28f09c0b5a62b03f5f009e4f
Be more paranoid about list-tests behaviour.

In test_run we were assuming that testtools.run -l wouldn't be evil and call
sys.exit(), but calling sys.exit() is the contract of TestProgram, so we should
be paranoid about it.

Change-Id: I72d81942322eb9c1d57356741fa0f3806ebf14e8
Indicate failed imports in list-tests.

Test listing now explicitly indicates by printing 'Failed to import' and
exiting (2) when an import has failed rather than only signalling through the
test name. This plus the introduction of a public helper lays the groundwork
for fixing a usability bug in testrepository caused by the interaction between
failed listings and user test filters.

Change-Id: I7fb8cb70c515c54d8febd68ba791c27db0a7a9c4
Closes-Bug: #1245672