base-manager: Watch out for NULL ids

... because g_str_hash can not handle NULL.

Fixes: https://bugzilla.gnome.org/725327
mode-controller: Special case activation by search provider

When a search provider result is activated, the application goes
directly to preview. Normally the transition to preview would have
happened from one of the other views. This leaves the "old mode" in an
undefined state. Special case the "old mode" to overview in this
situation.

Fixes: https://bugzilla.gnome.org/725329
mode-controller: Add photos_mode_controller_go_back

We have to track the previous or old mode in a number of places. Either
to implement the back button or escape key or to figure out which view
to switch to when the search constraints are removed. This helps with
that.

Secondly, we need to use a stack instead of a single variable for this.
A single variable is not enough to track transitions like:
 - launch application in overview
 - search for something (ie. overview -> search)
 - preview a search result (ie. search -> preview)
 - go back to search results (ie. preview -> search)
 - remove search constraints (ie. search -> ???)

At this point, with a single variable, preview is the "old mode", not
the overview. This is where having the whole history in a stack is
useful.

Fixes: https://bugzilla.gnome.org/725329