better handling of checkmode and async fix test to follow new flow control
see #23729
This change corrects problems reported by the `yamllint` linter. Since key duplication problems were removed in 4d48711, this commit mainly fixes trailing spaces and extra empty lines at beginning/end of files.
4d48711