release the connection filedescriptor before releasing the memory for the connection context