Add total_seconds method for Python 2.6 support

This implements the timedelta.total_seconds calculation for versions
less than Python 2.7