Couple of changes to prevent a crash if a database upgrade fails
bz19911: change format of timedelta columns in the database.

Rather than store a python repr, which has all kinds of issues, store
timedalta values in the form "<hours>:<seconds>:<microseconds>".