If the result image is nil, do not attempt to insert it in the cache.
Keep track of in-progress tasks to avoid duplication of effort.  Also, avoid inserting nil image into cache.

A nil image can result from someone sending CGSizeZero to the method.
I think calling completion with the nil image without crashing is a
good expected result for that case.
Un-separate synchronous vs asynchronous in interface; call operation block directly in synchronous case to guarantee completionBlock called before returning

waitUntilFinished was not reliable because it doesn't guarantee the
completionBlock being called, only the operation being completed.
Use CGBitmapContextCreate instead of UIGraphicsBeginImageContext to avoid threading issues when pulling UIGraphicsGetCurrentContext from multiple drawing threads
Revert "Keep track of in-progress tasks to avoid duplication of effort.  Also, avoid inserting nil image into cache."

This reverts commit f9be0bfb0d689d27f81d83c409fc635910bbd4ec.
Merge features/ns-operations
Merge branch 'nsoperation-CGBitmapContextCreate'
Label modified files per apache license.
Change weak pointer to unsafe, unretained for compatibility.
Add option to specify cap edge insets to return resizeable UIImages
Fix vertically flipped context drawing.