glsql: wait for connections to be released
When we clean up a test database connection, we issue a pg_terminate_backend to all pids. However, though pg_terminate_backend will return success, that just means at least one signal was sent. https://man7.org/linux/man-pages/man2/kill.2.html#RETURN_VALUE It does not necessarily mean that the connection has actually been released. This is leading to flakiness in our tests with pgbouncer. This change waits for all other connections to be released before attempting to drop the database.