Unlock mutex on thread cancellation
Update refs from merge