Fixed condition in TestMessageWrite, To prevent it from failing when there are more messages in queue