mds: use mutex to protect log segment list

prevent race between creating new log segment and trimming old
segment.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: defer encoding/submitting log events to separate thread

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>