Complete the use of the Lua state allocator.

The original work, in commit 44176181c728, failed to call the
lua_Alloc function to free allocated memory. Thanks to George Zhao for
the report (issue #3).

Lrealloc and Lfree functions were added to mirror Lmalloc and simplify
the code.

In the process two other bugs turned up. First, one caller of Lmalloc
tried to take action if the allocation failed, but this was
ineffective, as Lmalloc called luaL_error. Hence, Lmalloc was changed
not to abort on error. Secondly, in lgnu.c, Lmalloc was called
erroneously, to allocate a buffer later freed by regfree (and hence by
free); this was corrected to call malloc.

The resulting code has been tested with both Lua 5.2 and luajit
2.0.0-beta9.