Only have one search in flight at a time

JavaScript's single-threadedness makes the logic reasonably simple to
implement: If a request is in flight when a new one is requested, we
just set a flag saying we want a new search right after the current one
returns.

One situation that this logic doesn't handle is if inconsistently slow
searches (for instance due to a poor network). The best way to handle
this if it happens is probably to give $http itself a reasonably short
timeout and request a new search in the failure callback.

Signed-off-by: Ari Rahikkala <ari.rahikkala@gmail.com>