[BZ-1035338] add timeout for UrlConnection in UrlResource
(cherry picked from commit 4506dc93eb3c2c276cb5e91c0350d283599928d2)