Fix code used when atomic ops are unavailable.