fixed race condition when generating Packages.gz.

Fix for #12