Avoid conn leak in prepared statements, better err handling

If a prepared statement was not recognized by the server (for
example, if it was restarted), connections were not being properly
returned to the pool.

Additionally, the re-submission of the original query after the
preparation completed was not borrowing connections properly
(by finding the least loaded conn and incrementing its in_flight
count).

Last, if there was a connection error while preparing an
unrecognized prepared statement, that error was raised directly
instead of retrying the operation on other hosts.