Prevent DummyLogger from creating files

Here's an alternative solution to prevent the tests from creating `stdout_logfile` and `stderr_logfile` files (the issue discussed in #377).

The key is to detect the `DummyLogger` (I don't like checking the class name but couldn't figure out quite how to do it with duck typing without breaking anything) and to not create any handlers that create files.