CPython: cleanup trans_dealloc slightly
CPython: make trans_clear safe to call repeatedly

Previously, at least UNLINK_CHILD() call was unprotected. Remove
self->valid guard which seems extraneous, this function is never called
when TransObject isn't in a good enough state to directly invoke
INVALIDATE() or ms_notify().
CPython: empty freelist in env_clear()

Additionally remove some extraneous logic, move self->main_db decref
above mdb_env_close().