feat(util/script_state): add join method to Lua threads

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(util/script_state): add a lua hook function that checks for the interrupt flag

This is a very convenient feature for interrupting non-terminating user scripts.
Before this commit, the user had to manually invoke check_interrupt() in potentially expensive loops. Now, this is not needed anymore.

Remark: we still have to check whether this trick works with LuaJIT or not.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(util/script_state): add a lua hook function that checks for the interrupt flag