Add delays in test_connect_rid

Add delays in test_connect_rid to allow time for socket to close before address get reused.

Test with command line: for i in {1..100}; do ./test_connect_rid && echo ""; done