[Serialization] support AbstractLock and GenericCondition (#43325)
Locks should be unlocked when serialized, and GenericCondition should
drop their waiters.
Otherwise, we may try to serialize a running Task (the user should
normally be holding the lock around the data they are intending to
serialize), which will fail and error.