sys.socket: support OpenBSD 5.6.

Close #182.
* ext/posix/sys/socket.c: Change the order of inclusion of some
headers to satisfy OpenBSD 5.6.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
posix: fix bad argument errors for spawn.

* specs/posix_spec.yaml (spawn): Uncomment badargs diagnosis.
* lib/posix.lua.in (M.spawn): Fix argument type error message for
nil-valued argument 2.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
resources: don't truncate rlim structure field values.

With f8d8939 we were too zealous with changing all internal
types from lua_Number (et. al) to lua_Integer (et. al), where
lua_Integer is not wide enough to contain an rlim_t.
* ext/include/_helpers (checknumberfield, pushnumberfield)
(setnumberfield): New function and macros equivalent to the
earlier implementations of checkintegerfield, pushintegerfield
and setintegerfield respectively.
* ext/posix/sys/resource.c (pushrlimit): Set PosixRlimit table
entries with setnumberfield.
(setrlimit): Extract PosixRlimit fields with checknumberfield.
* specs/posix_sys_resource_spec.yaml (setrlimit): Remove
spurious braces.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Implement mkdtemp on unsupported platforms

mkdtemp() was not officially included in POSIX until POSIX.1 2008. QNX
does not include an implementation of it because it does not support
POSIX.1 2008. And, while many other operating systems implemented this
funciton in the late '90s. QNX did not follow suit.

Many other projects have found this method useful enough that they have
implemented it internally in order to provide an API for creating
temporary directories. So this patch implements a rough API for
generating temporary directories on the QNX platform.