Fix some memory leaks [cppcheck]

Signed-off-by: Boris Egorov <egorov@linux.com>

https://bugzilla.gnome.org/show_bug.cgi?id=740382
Fix a typo in get_page_at_coords() [cppcheck]

Both height and width of a tile must be positive.

Issue detected by cppcheck.

Signed-off-by: Boris Egorov <egorov@linux.com>

https://bugzilla.gnome.org/show_bug.cgi?id=740382