Fix test failures in later builds of IDEA

Formatter tests starting failing because PsiFileImpl.isValid was
returning false for them in recent version of IDEA... not sure
what changed, but this works around the issue and makes our tests
happy again.