(svn r4675) - Backport from trunk (r4501):
Fix: When, in a train that has multiple engines in front, the _first_
of those engines is sold, all the orders are copied to the second
engine (to ensure "seamless" operation). The next_shared/prev_shared
pointers where not updated correctly during this operation.