jbd: Refine commit writeout logic