`tui_terminal_after_startup` gets called right after resuming from
suspending (via `Ctrl-z`) already (not delayed as with the startup
itself), and would set `waiting_for_bg_response` to false then directly.
This results in the terminal response not being processed then anymore,
and leaking into Neovim itself.
This changes it to try 5 times always, which means that it typically
would stop after a few characters of input from the user typically, e.g.
with tmux, which does not send a reply.
While it might be better to have something based on the time (e.g. only
wait for max 1s), this appears to be easier to do.
Fixes regression in 8a4ae3d.
* handle_background_color: short-circuit if handled already
* Unit tests for handle_background_color
* set waiting_for_bg_response to false in tui_terminal_after_startup
By then it should have been received.