refactor: use std.object.type compatible metatables.

* specs/spec_helper.lua (prototype): Copied from lua-stdlib.
* specs/posix_grp_spec.yaml (getgrent, getgrgid, getgrnam):
Specify prototype responses for return tables.
* specs/posix_pwd_spec.yaml (getpwent, getpwnam, getpwuid):
Likewise.,
* specs/posix_sys_time_spec.yaml (gettimeofday): Likewise.
* specs/posix_sys_utsname_spec.yaml (uname): Likewise.
* ext/include/_helpers.c (LPOSIX_STMT_BEG, LPOSIX_STMT_END): New
macros for safe compound statement macro definitions.
(LPOSIX_CONST, pushnumberfield, pushstringfield): Use them here.
(pushliteralfield): New macro for literal fields.
(setnumberfield, setstringfield, settypemetatable): New macros
for easy return table creation.
(pushtimeval): Simplify accordingly. Set metatable._type.
* ext/posix/curses/chstr.c (luaopen_posix_curses_chstr): Ditto.
* ext/posix/curses/window.c (luaopen_posix_curses_window): Ditto.
* ext/posix/grp.c (pushgroup): Ditto.
* ext/posix/pwd.c (pushpasswd): Ditto.
* ext/posix/sys/socket.c (pushsockaddrinfo): Ditto.
* ext/posix/sys/utsname.c (pushutsname): Ditto.
* NEWS: Update.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>