Fixed GridPath::getPath

The algorithm must not walk upwards, thus the minimum value must be saved between loops.

(The old method breaks, when start position equals end position)