free error callback when destroying the connection