Fix for #255

Since this comes back from an async callback, it's possible the screen is rotated etc.
Therefore i've added an overide for the detached function, and the updateheading is only called when it's attached.
Should prevent the illegal state exception