Avoid creating an unnecessary inner class by reusing an existing one and fix some thread safety issue in URLHandlersBundleURLConnection.