GROOVY-7186: Close URLConnection getInputStream() after testing for availability

GROOVY-7186: Close URLConnection getInputStream() after testing for availability