Speed up coda generated @simd

Summary: The new support for ```@simd``` introduced a heavyweight coda for mimicking ```for``` scope rules.  The coda can hurt performance significantly.  The patch is a hack that speeds it up significantly, though it would be good to fix the problem more properly.  The patch also includes unit tests for the scope rule subtleties.  Perhaps someone more expert in Julia internals can point out a better fix.

The ```@simd``` in the original pull request #5355 inadvertently did not respect the scope rules of ```for``` and related behavior for zero-trip loops.  What was actually committed fixed the scope oversight (thanks!), though not for the zero-trip case.  Alas, the fix was expensive, for one of my examples it almost halves ```@simd``` performance compared to auto-vectorization introduced by #5355.  It's the sort of thing that gives a bad reputation to dynamic languages. :frowning: 

Instead of inspecting whether the index variable is defined or not, the hack uses a one-trip loop in the coda to induce whatever effect a ```for``` loop has scope-wise.  As circuitous as this is, it seems to be significantly faster then the previous approach, though it still hurts performance noticeably.

Ideally, there ought to be a way to identify at compilation time whether there loop index is local to the for loop or not..