Avoid race conditions when updating task library

* Consolidate task library manipulation to one class
* Refactor atomic file replacement to cope with task upgrades
* Always acquire task library flock when removing RPMs
* Don't link partially uploaded RPMs into recipe specific repos

Bug: 880855
Change-Id: I66ef39e0af94462298096bd9c1b9c5acd7edf0e6
Merge "Avoid race conditions when updating task library" into develop