Ported loadlib.c from Lua 5.2.3

'require' is fully 5.2 compatible from now on.

Signed-off-by: katlogic <git@git.git>