Fix bug in cache
Stop adding duplicate fences in waitFor

Fences I added here are also added by the compiler
when --cache-remote is enabled, but they don't do
anything if --cache-remote is not enabled, so they
don't need to be explicitly included here.
Relax task counting fences, add barrier fence

The task counting atomics don't need to imply fences
as these are handled elsewhere and we're really just
updating a counter.

For the barrier here, it's waiting on (not atomic)
local memory to change from a remote locale's put - which
is not legit according to the memory model... add
a fence (but I'd like to see a better barrier).