Python: fixed a memory leak in Graph.get_shortest_paths(), thanks to Maarten van Strien