Update Client.java

Added a bail out condition to the busy loop based on the practical (production!) experience that it can hang once in 10.000 times or so. Ie the condition that no error is reported but the client also never get the isConnected() condition flagged. Maybe due to unstable network conditions etc, ie. eternal reasons.