Reimplement luafilesystem via LuaJIT FFI.
It should be compatible with vanilla luafilesystem: http://keplerproject.github.io/luafilesystem/manual.html#reference
What you only need is replacing require('lfs') to require('lfs_ffi').`
[sudo] opm get spacewander/luafilesystem
Run resty -e "lfs = require('lfs_ffi') print(lfs.attributes('.', 'mode'))" to validate the installation.