prop140/prop278: use atomic counters to track memory usage

I want to be able to compress things in subthreads, but that means that using plain old statics for our allocation counters won't work.