Protect parts of interpreter with mutexes