Fix and refactoring of diff_print

* src/git2r_diff.c: Move duplicated code to function new function
  git2r_diff_print. Fix to write to file handle.

Signed-off-by: Stefan Widgren <stefan.widgren@gmail.com>
Add more diff tests

Signed-off-by: Stefan Widgren <stefan.widgren@gmail.com>