Fixed an issue where receiveTimeout might wait too long

receiveTimeout had been using the supplied duration for internal waits on the "received a new message" condition variable.  In instances where receiveTimeout would have waited multiple times and not received any matching messages, the function could wait well beyond the intended duration.  This fixed receiveTimeout to adjust the wait duration before each internal wait so the total wait time of the function will be as expected.