Fix lock deprecation

Uses `-performBlockAndWait:` if iOS 8