Add in detection of closed connections in the pool
Since this is not implemented for MySQL I will pass on merging it as-is, but I'll think about how this might work as it seems like a valid issue.
 Awesome, cheers Charles. I'll take another look into MySQL tomorrow to see what I can do from my end. Would be great to close this bug from my perspective :)
 Did you have any thoughts about how to develop this? I'm willing to lend a hand but don't want to go in the wrong direction if this approach isn't what you're thinking.
 I added a hook method which I believe should make it easy for you to implement your changes: ad50a51f9fa8669b8611964878d1ad0d87aa710e

Just subclass and override the `_is_closed()` method.
 Awesome that works for me, one problem is that I need to use the `conn` itself within _is_closed, can you add that as a param to the definition please. I just checked and there is no sane way of going from the `id()` of an object to the object itself in python :)
 Fixed in d442a92309c0ec437c18aa92293fe256933b4cf8

Hi Charles,

I've got a little problem with connection pooling, it works great up until the point I have to kill a hanging postgres query or stop the database service. Any requests on that same connection get an `InterfaceError: connection already closed` from the psycopg2 library because it successfully retrieves a connection from `_connect`.

The problem is that the connection pool is only aware of connections killed by the application and not the database server itself. This pull is my attempt to monkey patch a solution for postgres, I had a brief look into the MySQLdb and pymysql docs to try to also get a good solution for that but fell short so thought I'd pass it over to you to see what you thought.

Other than this minor problem, (which can be fixed by restarting the webserver, thus flushing the connection pool), this module has been running really well for me in testing, thanks again :)

Cheers,
Alex
