Move the "last task" hack into ReplaySession.