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