Use the debug interface to compare screenshots.

This way it's already implemented in all backends.
Centralize dx9 and gles headless stuff.

Well, could be cleaner, but this way all the comparison stuff works.
Workaround headless help not showing graphics.
Merge pull request #6809 from unknownbrackets/headless

Allow headless to compare Direct3D 9