Changed when to add states to the hash to increase its effectiveness for
only a small cost in performance in games without repeating states. Also
increased the time buffer to one second, as I noticed we were breaking
the time limit when we don't find a solution.