Fix "HTTPConnection instance has no attribute 'getreply'" issue

Apply and adapt patches from https://bugzilla.redhat.com/show_bug.cgi?id=621298

Signed-off-by: Stoicescu Corneliu <corneliux.stoicescu@intel.com>