fsmonitor: write state with wlock held and dirstate unchanged (issue5581)
This means that the state will not be written if:
(1) either the wlock can't be obtained
(2) something else came along and changed the dirstate while we were in the
middle of a status run.
#require docutils gettext
$ $TESTDIR/check-gendoc zh_CN
checking for parse errors