Workaround total_seconds not being present in python 2.6