Various GCD related fixes for SDImageCache

This hopefully addresses the issues outlined in #625 and #507, as well as a background task-related issue. The cache has also ben slightly modified to make more use of the private fileManager instance.