handle repohascommitafter timeouts and errors more appropriately
Created by: slimsag
This is a last-ditch effort to solve https://github.com/sourcegraph/sourcegraph/issues/4602 for 3.5.
It's a low-risk change because it only affects queries including repohascommitafter:
which is marked as experimental.