Preprocessor: support defined() with operator names for MS compatibility

Also flesh out missing tests, improve diagnostic QOI and fix a couple of corner
cases found in the process.

Fixes PR10606.