lib.util: assume std qnh if None given
lib.xcsoar_.analysis: return flightpath of flight for further processing
model: add ContestLeg table

This table is intended to store the legs of a optimized contest result.
It overcomes some shortcomings of the traces table and will therefore
replace it.

The main benefits are additional columns to store leg statistics like
circling duration or total height loss. These values cannot be calculated
without the complete flight path and are therefore to be evaluated on
flight analysis.
lib.xcsoar_.analysis: save contest legs to contest_legs table

Only basic information for now.
lib.xcsoar_.flightpath: add cumulative_distance function

Sum up the total distance between two fixes.
lib.xcsoar_.analysis: calculate leg statistics
frontend.views.flight: add legs formatter
model.flight: add contest legs getter
templates.flight.view: show leg statistics
Merge PR #360: Show leg statistics