fix error and mem leak found by cppcheck

I ran cppcheck on luaDist/lua and it found these errors:
loadlib_rel.c	202	resourceLeak	error	Resource leak: fd
loadlib_rel.c	193	uninitvar	error	Uninitialized variable: n

First one was in the #else and second one in the #elif defined(__APPLE__)