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>