Test for the presence of a yaml parsing log message. Fixes #6714.

Additionally, moved the yaml syntax error checking to the proper place.