Fix segfault when using libedit

readline.lua calls rl_completion_matches with an argument that doesn't exist, resulting in NULL being used as the argument.  This works with readline proper, but not with libedit (which implements the readline interface as a compatibility layer), which requires the first argument to be a valid pointer to a string.

This commit also fixes a few similar uses of global variables that appear to have been intended to be local, allowing iluajit to be used when 'strict.lua' has been required.