Make sure connections are returned to the right pool

JAVA-255 #fixes