Only restore the context on preventDefault

preventDefault() appears to *set* the cancelled flag, so we should abort context restoration if the cancelled flag is *not* set.
Merge pull request #550 from jdashg/context-handle-los

Only restore the context on preventDefault