test: fix race condition in test-http-client-onerror
I've noticed an error pop up very rarely in test-http-client-onerror, where the test fails whith a refused connection. Tracking it down I believe the issue is that the test is written such that connections could be attempted before the socket is listening