Problem: Tests using term_wait() can still be flaky.
Solution: Increase the wait time when rerunning a test. (James McCoy,
closes#5899) Halve the initial times to make tests run faster
when there is no rerun.
Problem: Execution stack is incomplete and inefficient.
Solution: Introduce a proper execution stack and use it instead of
sourcing_name/sourcing_lnum. Create a string only when used.
Problem: :let-heredoc does not trim enough.
Solution: Trim indent from the contents based on the indent of the first
line. Use let-heredoc in more tests.
Problem: Tests do not run or are not reliable on some systems.
Solution: Use "findstr" instead of "grep" on MS-Windows. Clear
PROMPT_COMMAND in the terminal test. Delete temp file. Wait for
output after executing a debug command. (Yegappan Lakshmanan,
closes#4479)