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.