GROOVY-7186: Try to open URLConnection in finally block

Try to open URLConnection to test resource availability in finally block