Add verification of context state in __dealloc__.

If the context is closed but not the deleted and
Socket.__dealloc__ is called by the garbage collector
exception are thrown when executing the _check_rc
function.