cmds: return a consistent result from Rebase

Signed-off-by: David Aguilar <davvid@gmail.com>
models.main: remove unused import

Signed-off-by: David Aguilar <davvid@gmail.com>
app: route inotify events onto the main thread

This avoids segfaults caused by trying to update widgets from a
secondary thread.

Related-to: #351
Signed-off-by: David Aguilar <davvid@gmail.com>
completion: handle deletion of underlying C++ objects

The Python wrappers around the PyQt4 objects do not always
get notified when their C++ side has been deleted, specifically
the destroyed() signal from QLineEdit is never delivered.

Now that we are delivering inotify events on the main thread
then we can properly catch this error by automatically disposing
the observers when the underlying widget has been destroyed.

Closes #351

Reported-by: Stanisław Halik <sthalik@misaki.pl>
Signed-off-by: David Aguilar <davvid@gmail.com>