Avoid timedelta.total_seconds() to fix Python 2.6 compat