make monitor test more robust

on freebsd the socket connect is not delayed and succeeds immediately
Merge pull request #558 from juliantaylor/monitor-test-robust

make monitor test more robust