Clean up double-checked locking

Based on Effective Java 77, this cleans up double-checked (and single-checked) locking instances to first retrieve the volatile member into a locale cache variable.  The point of this pattern is to speed up the fast case: if the cached value is present, there is only a single memory-fenced volatile fetch (to read the variable). Without it, reading the field twice, there are (at least) two memory fences.