Improved tests and fixed found bugs.

- Added test utilities.
- Fixed LoggerFileOutput::open() returning true when trying to open
another file while still open.
- Fixed crash when trying to pass a nullptr to
LoggerFileOutput::write().
Small change to test CMake file.