Fix crash which happens when one of the search history files is corrupt.