Avoid access violation in ConnectionProxyStream.close(). See #384.