SI-8367 Fix positioning of extends, super in bodyless templates

A refinement of the fix in ac779096.

Just submitting this for pr-validation against scala-ide, scala-refactoring, as I expect problems.