search: Don't let errors shadow successes.
search: Don't let errors shadow successes.

If e.g. request 5 fails and then request 4 succeeds, we should show
the results from request 4.  Instead we were discarding 4's results,
so that we'd keep showing whatever results we previously had from some
still-older request.

This happened because we'd update `lastIdReceived` on failure as well
as on success.  The purpose of that is to clear `isFetching` when our
latest request has failed as well as when it's succeeded, which is
good.  But that wasn't actually working either: when 5 fails, we'd set
`lastIdReceived` but not actually call `setState` to act on it, so
we'd keep saying `isFetching: true`.

Fix the latter issue by calling `setState` promptly where we update
`lastIdReceived`.  To fix the former, we need to track the latest
request we have a *successful* result for, rather than the latest we
have any result for.  Introduce a new property `lastIdSuccess` for that.

vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile