Changes synchronization between LogFile and TransactionAppender

such that transactions cannot be appended and rotated away before properly
applied and closed. TransactionAppender now grabs the same monitor while
appending, as LogFile does when rotating.
Merge pull request #2965 from tinwelint/2.2-append-and-rotate-control

Changes synchronization between LogFile and TransactionAppender