[#11] NoSuchElementException during twirl compilation

Pull request to fix issue [#11](https://github.com/spray/twirl/issues/11).

This change is an exact port of a [Play 2.0 bugfix](https://github.com/playframework/Play20/pull/590). I have made no additions or changes to the original.