Add workaround for Python 2.6.

Python 2.6 does not include the ```total_seconds``` method for ```datetime.timedelta``` 

https://docs.python.org/2/library/datetime.html#datetime.timedelta.total_seconds