fix tmpname when running under node

When running under node, emscripten uses the real filesystem. In this case, `dir` is never set inside `tmpnam` you get a path back like `undefined/foo` and it breaks my code because it can't actually create a file there. This seems to fix it.