[[ Bug 12230 ]] Make sure LockSystemContext returns a result, otherwise ...

...CoreGraphics tilecache doesn't work.