Clear the CSS and JS cache earlier to make sure update goes smoothly

I moved the clearing of CSS and JS caches from ajax/update.php to lib/base.php

There was an issue with the Event Source js failing because the browser was using an old cached version of the eventsource.js file. This prevented the update from occurring until a refresh.

Maybe fix for #1520 

@karlitschek @schiesbn @MTRichards