handle IllegalStateException from Surface.lockCanvas

Symptom: SystemServer crash because of this exception on startingWindow
Root Cause: IllegalStateException from Surface.lockCanvas
Solution: handle IllegalStateException from Surface.lockCanvas

Change-Id: Ifb1b3b72877dfd9994ebf17dcef4778f88821301