monitor: Monitor uses almost all others, so it should be stopped at first.
monitor: use one lock_guard for both: checking backend state and dumping backend json.
Merge pull request #538 from shaitan/master

monitor: fixed rare crash