Use luaL_checkoption instead of get_action_id.

Check that animation exists before dereferencing.