This commit adds some necessary locking to ensure that all updates to the internal state of the commitment state machine are fully serial and thread-safe. This change is required to ensure future actions w.r.t taking action once a revoked commitment transaction has been broadcast are not carried out while the channel’s state is being updated.