fix Issue 11822 -  switch causes ICE with  return and other stuff

This is an alternate to the fix https://github.com/D-Programming-Language/dmd/pull/3034

It includes the same test cases.

https://d.puremagic.com/issues/show_bug.cgi?id=11822