Don't overwrite cache timestamp until after build has been compiled and saved.

I am using asset compress build_ini task on our live server in our deploy script, but was having problems because the build timestamp cache file was being overwritten before the compiled file was generated, which caused visitors to get 404 errors when visiting the site, which were then cached on our CDN causing problems for everyone.
But invalidate() still calls setTimestamp() just like before. Wouldn't the same problem be present still?