Fix for current open overtaking issue and a test for overtaking issues

I think this fix now gets rid of overtaking issues in the mutual_thread_comm library. This is assuming that the user uses only XC to perform the communication between client/server.