Don't deadlock if askPermissionForUrl: is called from the main queue.

dispatch_sync() is documented to deadlock if the target queue is the
same as the current one.  This happens when AppSandboxFileAccess is used
from the main thread.  Fix the deadlock by explicitly checking for the
current queue and calling the block directly.