Abort early if TMPDIR is non-writable or non-executable

Fixes #148
Bash here-document doesn't work with non-executable TMPDIR

Fixes https://travis-ci.org/sstephenson/ruby-build/builds/13131225
Merge branch 'tmpdir-noexec'