ve.ce.Surface.getSelectionRect() might return null

Protect against this. Also fix misnesting of updateDimensions()
function's body.

Change-Id: I5040d46d51bd59bf4d2fd7d4d8853c8675420ad0
Merge "ve.ce.Surface.getSelectionRect() might return null"