ISPN-2699 Transport object factory propagates Ping exceptions

* Changed the way response header is changed so that all values are
read as soon as possible, hence reducing the chances of sockets being
left with unread data in case of any exception.
* Use generics properly in Apache pool object factory implementation
for Transport objects.