Fixed dead lock imported in last patch

This dead lock is caused by wrong use of gMutex lock, and a mistake of extra closeSignal's set.