[cm3/sync] Add mutex_trylock()

Allows non-blocking use in user code.
[cm3/sync] mutex_lock now calls mutex_trylock repeatedly