do our own userdata object validation instead of letting Lua raise a hard error