BUG: shortest_path overwrite

Intended to close https://github.com/scipy/scipy/issues/3800.

Other csgraph functions may need similar attention?

Are the in-place changes made by validate_graph (for `overwrite=True`) idempotent?
Does something go wrong if this call modifies in-place, and the second call later on also does something?