As these values are read in different thread, change them atomically to avoid crashes
Fixes #737 (closed)