Use os.tmpdir() on Linux

/tmp isn't always available, is on precious RAM-backed fs or simply not
what the user has set his $TMPDIR to. According to the specification, we
should use $TMPDIR, which node lets us find through os.tmpdir().

Also, contributing.md isn't in favour of using platform-dependent code.

This commit focusses only on Linux, and leaves OS X as is with /tmp for
discussion.
Use os.tmpdir() on OS X
Consolidate redundant code
Minor fix + Remove last references to /tmp
Merge pull request #2269 from pritambaral/tmpdir

Use os.tmpdir() insted of /tmp