scripting: no eval with negative key count

Negative key count causes segfault in Lua functions.

Fixes #1842
Closes #1843