Fixes #1839: Companion simulator Lua crash on Mac