Merge pull request #1882 from abergmeier/safe_ensure_dirs

Introduce safe_ensure_dirs as a safe os.makedirs replacement.
differentiate external vars from funcs in fastcomp
fix for pull #1882
make posix_madvise standlone
return 0 on fread on invalid stream
fix file preloading in workers and add test
report better error in fread on bad stream
use externs for fastcomp vars and declare for fastcomp funcs
move import in cache.py to avoid module interdependencies; fallout from 0f5135e436 breaking test_llvm_nativizer
be sure to not emit an external ref as both a var and a func in fastcomp
Tag current state
Remove pc file check
Rename `ensure` to `download`.
Add stub purge and remove commands
Remove name attribute of Version.
Add current code
Add implementation of purge and remove commands.
Use `urllib.urlretrieve` for all fetches, since it supports file:// retrieval already.
Only switch to special handling for file:// URL being a directory.
Thus we no longer need `requests` module.
Set EMSCRIPTEN_ROOT environment variable so executable may be referenced absolutely.
Execute local commands via `sh` so the behavior is similar on all platforms.