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
commands-file: save_as_tab_async()/finish()

Before this patch, save_as_tab() was used for various other bigger
tasks. When a tab was saved, it looked if there were other tabs to save,
or if the tab should be closed.

Now save_as_tab() is an async function with the conventional
async()/finish(). Bigger tasks can be accomplished in the ready
callback, but it'll be done in later commits for clarity (see the TODO
comments).

https://bugzilla.gnome.org/show_bug.cgi?id=739686
commands-file: save next tab in async ready callback
commands-file: async/finish version of gedit_commands_save_document()

The important part is the finish(), to get the result. Because
gedit_commands_save_document() was already async, but it was difficult
to know whether the document was correctly saved (by listening to the
GeditDocument signals it _was_ possible, but it's no longer possible
because the error parameter has been removed from the "saved" signal).

https://bugzilla.gnome.org/show_bug.cgi?id=739686
Port the external-tools plugin to the new file saving API

Listening to the "saving" and "saved" signals, with a counter to know if
all documents are correctly saved, was quite hackish. The new gedit API
is cleaner, with GIO conventions for async operations.

Anyway the port was needed because the code was broken. The "saving"
signal has been removed, and the error parameter of the "saved" signal
has been removed.

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