Added luacheck for linting Lua files and static analysis

This is super useful for checking things like misusing undefined
variables or modifying globals, especially in modules when it's
not immediately visible which variables are in the global
namespace and which are not.

I added several exceptions for files in daemon/lua and tests,
as for example sandbox module needs to legitimately modify
global namespace.

There's a lot of things failing, so I didn't make it part of the
standard `make check`, but we should eventually enable it to
improve code quality and spot problems with CI.
7 jobs for add-lua-linter
in 3 minutes and 24 seconds and was queued for 1 second