Release the flush lock if there is nothing to do.

Fixes the issue that all logging stops the first time _flush is called
and there is nothing to send.