Cache fixes

Fixes bugs, including fixes removed from NetworkAtomics (whoops). See individual commit messages.
Determining how many tasks there are has synchronization implications.

The major problem we were solving when we put the running task counter in the module code was races that caused the second of consecutive parallel constructs to create (typically) too few tasks because the previous construct's task count decrements hadn't been seen yet. Maybe what's really needed is: relaxed consistency for Set() and Add(), release for Sub(), and acquire for Read()?