Update path.rs

Modified handle() so that it doesn't call solve() when End is
encountered. Also the special handling of End at the beginning of solve(),
because the above change makes it illegal to call solve() with End.