fix to use recursive mutex in MessageQueue class