addresses GH #16
We were already locking down the cache while searching through it with alpm_find_satisfier, but we can hit a race simply on retrieval of the cache from alpm, so lock that up into the same critical section.
this was introduced by 1cae0b, which added locking callbacks for openssl. If we exit with error from set_download_path, we jump to the finish label and attempt to cleaned up mutexes which were never initialized, resulting in an unfortunate segfault. thanks to phsi of #archlinux for being an ass about pointing this out.