retry connections three times before failing

looks good, if we are up to Java 7 here we can do multi-catch