Fixed small bug in the UndoRedoHandler

To reproduce:

1. Open file, change it and save the change
2. Open different file

=> New file appears to be changed as well even though
   it is not

Should be fixed now...

Signed-off-by: Wilson Brenna <wbrenna@uwaterloo.ca>
Manual patch of fix for bug #68

Needed to free allocated locale. Also port upwards to gtk3.
Merge branch 'master' into addpoppler