fix race condition in mutex release

setting mutex and held_by is not atomic.
if we get yielded twice in between that can result in failed assertions in the aquire/tryaquire methods