[gedit] fix some leaks and other stuff