Fixes null pointer exception because the Tmcs.java, switchTrafficLights(...) code was checking the next route of a train when the train is at the end of its journey so the next route may be null.

This fixes the problem with the test case:
   TCMS_Simulation_event_input_7.txt -> null pointer exception when a train moves to a second leg of its journey while there is another train starting from that same route.