Data compression fix in flash_log_write()

- also, added compression error counter