darwin: properly ejects ramdisks

In the move away from extensive global variables and improved cleanup
routines, we forgot to fix the darwin platform file, which means
temporary ramdisks never got unmounted. This patch cleans up the general
cleanup trap logic routines.
darwin: fix mktemp argument order