[python] Convert timedelta to total seconds