[diff] Fix extension, don't treat empty file as text

* Add "." to the temp file suffix to produce the file extension.
* Don't treat any empty file as text with stub content:
  let it have the same type as detected by extension. This will show
  "Image can't be loaded" warning, for an empty jpg file, for example,
  but it is expected behavior.
  This doesn't affect ADDED changes: they don't have before revision
  at all and don't create FileContent for them.