It's important to actually tell your motors to stop after commanding the drivetrain to move forward for 5 seconds. Otherwise your code will go on its merry way, but the drivetrain will continue to be commanded.
Regardless of how you end up implementing the code you need to explicitly command the motors to 0.
lineskier's code does this:
Code:
robotDrive.drive(0.0, 0.0);
It's an important item that should not be overlooked.