Small fix for usage of luai_writestringerror.
Added support for custom file I/O.