Followup 3dd1a996: don't try to switch to source mode when surface is torn down

If you saved a change, then clicked Edit source, you'd get a JS error.

Change-Id: I589f9edb354afcd47d5c42ef9a6c73d49218b044