Position line-following labels at the mid point of the polyline
This produces significantly better results than the previous hacks, in
particular along curved lines. Specifically, the text is now actually
always on the line it is supposed to follow.
This is still not perfect though, long text in sharp turns would need to
be either moved to a longer adjacent segment, or broken into parts that
are layouted individually.