Optimize the construction of the source-destination map in ST_ShortestPathLength

* Close the ResultSet
* Select only columns SOURCE, DESTINATION