Search revamp

I know you don't like defer, but I always feel safer using it for these situations. The guarantee that this code will run and there will be no deadlock or race condition is comforting. This is not getting called a large number of times, so there is no cost.