make use of simulator thread safe through okra_create_kernel

This change uses  mkstemp and a mutex so concurrent use of okra_create_kernel will work.