Backports commit 44368ac62dc5ba014b68b2c1a8ec6fedc3242a5d from qemu
Cleaned up with scripts/clean-header-guards.pl. Backports commit 175de52487ce0b0c78daa4cdf41a5a465a168a25 from qemu
Tracked down with an ugly, brittle and probably buggy Perl script. Also move includes converted to <...> up so they get included before ours where that's obviously okay. Backports commit a9c94277f07d19d3eb14f199c3e93491aa3eae0e from qemu