fixed bug that could leave rqt_console unable to receive messages

Much cleaner mutex code. Ensures we don't do something funny and leave the mutex locked