xbps{,-static}: fix races in the cache connection code of libfetch.