Fixes race that can cause duplicate writes in XaLogicalLog

There is a possible window where a transaction may fail to flush
 the log buffer (for example, during a commit) and even though
 it will set the KernelHealth to notOk, another thread can still
 come and try to flush the same contents again (say, by attempting
 a commit of its own tx). This can cause the log to be unrecoverable.
 This commit fixes this issue by introducing checks to KernelHealth
 before any write happens to the log's underlying file.
Merge pull request #2326 from digitalstain/1.9-fix-damaged-log-writes

Fixes race that can cause duplicate writes in XaLogicalLog