The depth dependence of earthquake duration and implications for rupture mechanisms