fix(lua): redefine Lua 'print' function, and make sure it is thread safe

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>