Added check for BSD variant of mktemp on OS X