This function returned the duration in frames for a keyframe, but for keyframes that are implicitly held until the next keyframe, it makes more sense to return 0. For `insert_frame` a duration of 0 also creates an implicit hold so this is more consistent with this API and removes a few checks elsewhere.