Bug 1038174 - Prevent a race condition when writing the experiments cache. r=gfritzsche, a=sledru

We now mark the experiments cache as clean before writing the cache.
This means that any changes to the data between collecting it and when
the actual write executes will properly mark the cache as dirty.
Bug 1052545 - Telemetry experiment branches are not saved correctly: we set the _dirty flag correctly, but then don't write the cache, r=gfritzsche, a=sledru