#9881 MDS flush journal test

This is based on #7317 to avoid awkward merges later: ignore the commits up to 'hook in mds_full task'.