Fix BTSerialComm class doLock () and doUnlock () issue non-atomic operation.