debug log client disconnects
Improve instrumentation around fwrite() in test