os/FileJournal: Update the journal header when closing journal

When closing journal, it should check must_write_header and update
journal header if must_write_header alreay set.
It can reduce the nosense journal-replay after restarting osd.

Signed-off-by: Ma Jianpeng <jianpeng.ma@intel.com>
Reviewed-by: Sage Weil <sage@redhat.com>
os/FileJournal: signal aio_cond even if seq is 0

This can happen if we write a journal but no events.

Reported-by: Somnath Roy <somnath.roy@sandisk.com>
Reported-by: Ma, Jianpeng <jianpeng.ma@intel.com>
Signed-off-by: Sage Weil <sage@redhat.com>
os/FileJournal: For journal-aio-mode, don't use aio when closing journal.

For jouranl-aio-mode when closing journal, the write_finish_thread_entry may exit before
write_thread_entry. This cause no one wait last aios to complete.
On some platform, after that the journal-header on journal corrupted.
To avoid this, when closing jouranl we don't use aio.

Fixes: 9073
Reported-by: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
Tested-by: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
Signed-off-by: Ma Jianpeng <jianpeng.ma@intel.com>
Merge remote-tracking branch 'gh/wip-filejournal'

Reviewed-by: Sage Weil <sage@redhat.com>
Tested-by: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>