Logging: Fix a bug in flush

Signed-off-by: Paul Harrison <pharrison@mythtv.org>
(cherry picked from commit 53c5ef0a64df6bf542ec45da0b98f762ba93d0cc)