Fix Connection Pool issues

Recursion caused a subtle leak.
Added a Set to protect against double free.