Remove error message buffering
When flush failed, log messages are not dropped
1. Fix a bug which makes flushing lock remains true
2. Remove unnecessary error returns