(#23273) ignore empty YAML files

YAML.load returns false or nil for an empty file and for a file with
only the YAML header respectively. This commit uses {} as a safe default
value and returns it when nil or false is encountered.
(maint) Add test coverage for unexpected YAML values
Merge branch 'pull-162'

This closes GH-162.