lib/temp.js: fix typo

'os.tmpDir()' => 'os.tmpdir()'

see: <http://nodejs.org/api/os.html#os_os_tmpdir>
lib/temp.js: use 'osenv' module instead of core's 'os'

should provide backwards-compatibility till node v0.6

see: <https://npmjs.org/package/osenv>