MotionPlanner: save some RAM.
Only make the segments array as large as it needs to be, instead of
making the size the smallest power of two which is larger than the size
we actually need.