closed #4542: wrap the code of mutex

@dumganhar it just crash in win32.