Avoid insertion from front of list in bidirectional_shortest_path.

This applies the patches provided in:
    https://groups.google.com/forum/#!topic/networkx-discuss/ULpDth-GAGU