'writeLog()' mock don't accept 'NULL'

Hand-written mock implementation assert against 'NULL' pointers
Guard against unterminated strings in test suite

"test_control_logging_tests.c" now has a limit on how much data it
tries to copy to the 'writtenLogEntry' buffer
Add TODO

Also, minor change to 'readFromMasterCallback()', there is no need
to copy the buffer unless we're returning a non-zero buffer length