mds: fix race of trimming log segments

trimming old log segments can start new log segments, make sure
MDLog::trim_all() not expire newly started log segments.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
Merge pull request #3052 from ceph/wip-flush-journal-fix

mds: fix race of trimming log segments

Reviewed-by: John Spray <john.spray@redhat.com>