Fixed a concolic search bug and added a test.

Fixed a bug where the DFS would get into a bad state when it tried to explore a node which was the final leaf in the tree and failed (for any reason). It would then not check whether we were at the end of the tree and try to continue.

This seems to have come up quite a bit in the real sites testing.

Also added a test which triggered this behaviour.