Fix tcp-connect-fail test.

Sometimes it gives 'timeout' and sometimes 'connection refused' error.