Fix a duplicate luaL_unref eventually leading to a crash later (#224).

Also add assertions to detect duplicate luaL_unref much earlier next
time.