[MLIR] Fix generate-test-checks.py to not remove every blank lines (#166493)
The stripping of the notes was done on a line-by-line basis which was
fragile and led to remove empty lines everywhere in the file. Instead we
can strip it as a single block before splitting the input into multiple
lines.