Performance optimizations for best-first selector

Mostly revolving around finding single paths. This gives a good
improvement when calling PathFinder#findSinglePath for those graph
algorithms using the traversal framework and more specifically the
BestFirstSelector. Currently this will benefit Dijkstra and A*, although
the default implementation of A* is a custom non-traversal-framework
version that only supports single paths anyways so already has got a
similar performance behaviour. Look at TraversalAStar for a A* version
that uses the traversal framework.
Merge pull request #1369 from tinwelint/1.9-dijkstra-explosion-fix

Performance optimizations for best-first selector