refactor: factor Lua argument checking into helper functions.

* lib/posix.lua.in (argerror, toomanyargerror, argtyperror):
Argument error message management, inspired by stdlib.
(checkstring, checktable): Check argument types, inspired by Lua
C API.
(creat, getgroup, pipeline): Simplify accordingly.

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