What are the trajectories of flying insects?
Dickinson (2005) has a good review of insect flight, including behavior, biomechanics, electrophysiology, and neural control with links to more of the primary literature. What follows is a general summary thereof.

The jagged trajectories you mention are called saccades in the insect flight literature. In Drosophila, saccades are ~90° turns accomplished in approximately 50 ms. Because flies can't move their eyes independently of their heads, saccades are though to allow a relatively constant visual field most of the time, interspersed with rapid reorientations during which the fly is "blind."

The actual turn begins with the generation of a torque, which starts the fly turning. Shortly thereafter, the halteres sense this change and a counter-torque is produces, which stops the turn.

Rather than random turns, Drosophila are turning away from visual expansion as they near objects. So as they move closer to an object, it expands in their visual field, and they turn away from it.