Relay::select() throws a TypeError for anything but an integer, where
other connections get an error response from the server. Wrap the call
and return the same error response, so the existing test runs against
Relay and no longer needs a Relay-only counterpart.
Relay warns before sending SELECT for out-of-range databases, so that
test keeps its Relay-specific counterpart.
Disconnect interrupted pipeline connections before they can be reused,
discard remaining commands, and reset running state after PHP errors.
Preserve the original failure when connection cleanup also fails.
Clear the cached connection resource when Relay is closed so the next
command reconnects and replays connection initialization. This fixes
client reuse after an interrupted pipeline disconnects the connection.