tempdir: use `os.tmpDir` when possible

use node's native `tmpDir` when possible, but fallback to the python's algorithm in old (really old) versions of node