(This commit also modifies the frontend-tools module) Prevents a potential crash when script_log is called by a thread spawned by a python library.
Allows Lua/Python scripting support.