Previously, variables bound outside `while` loops were not substituted
inside even in the absense of mutation. Add the necessary mutation
checking inside loops to allow propagation of values and aliased
variables.
* lisp/emacs-lisp/byte-opt.el
(byte-optimize--inhibit-outside-loop-constprop): New variable.
(byte-optimize-form-code-walker): First traverse each loop without
substitution to discover mutation, then without restrictions.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-loop): New.
(bytecomp-tests--test-cases): Add test cases.