Move preventDefault earlier in changeHeading

Any errors in later processing causes the browser to follow the link, because
it never reaches the preventDefault. If we're going to prevent the click from
following the anchor anyway, might as well do it first.
protect against Aloha.currentEditable being null upon heading changes.