Now only update database for running lines

Added a check to the update_lines function to only add the latest
arrivals to the database for lines that are currently running, or lines
that have recently stopped running.