Fix compilation on compilers which do not have Atomic built-in
Differential Revision: https://phabricator.kde.org/D16184 Patch by Krzystof Kurek, thanks!