lua/api: fix object constructors to fail gracefully

8 jobs for master in 1 minute and 35 seconds (queued for 5 seconds)
latest