Adding kernel mutexes for thread synchronization, resolving exposed heap issues.