Add in detection of closed connections in the pool

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