md/cluster: fix deadlock when node is doing resync job