Move some connection state reset logic into ConnectionProxy.close() to avoid additional method invocation overhead.