Some improvements in Workers precaching

Two small changes. It precaches files only when they're not available (this makes Worker startup faster) and it avoids a long living transaction to the database.

They may not be suited for CMS 1.1, I'm not sure.