Fix in local_dot22_to_dot22scalar

This should fix gh-1507.

NEWS.txt:
- fix crash in optimization involving dot22, reported by @micklat