Rescue from Errno::ECONNREFUSED.

Response to GH issues #579 and #663.