How to change the handle_type of a keyframe I've just inserted? In the VSE, I create a new effect and a keyframe for a property (speed_factor):

scn = bpy.context.scene
sp = scn.sequence_editor.sequences.new_effect("speed",
        'SPEED', 7, start_frame, seq1 = s)
sp.speed_factor = 0
sp.keyframe_insert('speed_factor', frame = start_frame)


How do I then change the handle_type of the keyframe to VECTOR? It seems odd to me that keyframe_insert only returns a success flag rather than some kind of reference to the keyframe I've just created.
I figured out a way to do it but in my opinion it's not ideal:

keyframe = sp.id_data.animation_data.action.fcurves[-1].keyframe_points[-1]
keyframe.handle_left_type = 'VECTOR'
keyframe.handle_right_type = 'VECTOR'


It's not ideal because the action might have other fcurves but it solves my case because I know it doesn't for my particular problem.