Redirect test output to a log file

Otherwise it gets mixed with the rest of the
shell.log.
Support SUGAR_TEST_LOG variable

This will be useful to redirect the test output to a know location
outside the profile so that buildbot can watch it. In this case just
append to the file instead of overwriting, the caller can delete the
file if that's the behavior it wants.
testrunner.py - better check for None