Fix for python 2.6 not having timedelta.total_seconds()