gsl_memmgr: release mutex before returning
kos_lib: move kos_mutex_create and kos_mutex_lock inline to fix lockdep errors