Use opaque type for gdt_table declaration

Hide implementation details from the C API.
Avoid exposing unsafe gdt_element with NaN encoding to the external
world.
Move gdt_table_get index checking in Lua code

More coherent with other functions like gdt_table_set_*.