Teach while loops to not hang forever with no-execute

Fixes #1543