RoutePolar: assume only straight glide in intersection()

This fixes a major breakage in the terrain warning calculation.

Commit c730a601f changed the min_height calculation, and caused the
regression; a bogus terrain warning would always be calculated right
before the destination, given that the destination is not reachable
according to GlideResult.

The commit however is correct, previous behaviour happened to be two
bugs compensating each others.  With a large (bugged) min_height
value, h_diff is always zero, and an intersection is usually not found
in "gradual climb to destination" mode (unless the aircraft is already
below the next mountain top).  This suppressed the bogus terrain
warning.

With the corrected min_height value and an unreachable destination,
intersection() assumes cruise-climb.  The cruise-climb mode however is
severely bugged, its formula will always result in a terrain collision
in the final "glide" part.

This patch is a radical approach at fixing the problem: it removes
nearly all of the code from intersection(), leaving only the pure
glide mode.  This is the only thing we should ever need for the
terrain warning.  Assuming cruise is wrong, because this should be a
realistic calculation based on current altitude; when you assume that
you can always get lift, then your potential glide path is infinite.
While this may be desirable for a pilot, it is not realistic.
debian/rules: remove "-j8" flag

This is the wrong place to do it, it should be passed to debian/rules.
debian/control: add build dependencies on xcolor, pgf, curl
LX/LXN: Changed num_tps to signed 8-bit integer

A valid IGC file read with LXe indicates that this is a signed integer.
The same flight read with XCSoar failed the validation test because it
read 254 at the same position.
MapWindowGlideRange/OpenGL: close the polygon, closes #1525
Android/Main: Don't set default profile name

This is not necessary and causes a skip of the profile selection
dialog on startup of XCSoar if multiple .prf files exits.

Fixes trac issue #1814
NMEA/Derived: Don't expire calculated.wind_available

The last update time of different wind sources was simply copied to
calculated.wind_available. However the expiry threshold for
calculated.wind_available was considerably shorter than for the real
wind sources often causing the immediate expiry of it here leading to
constant available/!available transitions.

Since DerivedInfo::Expire() and WindComputer::Select() run at different
times this lead to inconsistent availability information in different
areas of xcsoar. E.g. for the task engine the wind was invalid but for
infoboxes and the wind arrow it was valid.

Fixes trac issue #1807.
Weather/NOAAGlue: Fix parsing of weather station codes read from profile

Fixes trac issue #1825
Device/Descriptor: apply naming convention

Prepare for easier merging to master branch.
.gitignore: add *.s

Temporary gcc files.
Device/Descriptor: make the base class private

Don't expose the Port::Handler base class, it's only used internally.
Device/Descriptor: make LineReceived() private

The base class is already private.
Device/Descriptor: don't auto-reopen the Android internal GPS

In case of failure, or if the GPS is disabled, reopening the client
object doesn't help, and only annoys the user.  Let's disable this.
Android/InternalGPS: fix deadlock when internal GPS is disabled

The synchronous updates caused a severe deadlock (TRAC #1816): the
(native) UI thread creates the InternalGPS object, which posts a
message to the Java main thread and waits for its completion.
Meanwhile, the Android Activity gets paused, and the Java thread
waits for the native UI thread to handle the PAUSE pause event.

This commit makes update() and setLocationProvider() non-blocking.
The new method close() waits for completion.

It implements a new way of shutting down the object; a new flag tells
us that the native code has requested to dispose the InternalGPS
object, and with this flag set, native methods will not be called.  A
reference counter keeps track of how many native method calls are
currently running.  The method close() will wait for this reference
counter to become zero.
Android/InternalSensors: date is supplied by the internal GPS interface
Android/InternalGPS: check date_available
NMEA/Info: merge date_available together with time

date_available was never set if a device supplied the time.
GlideRatio: fix off-by-one bug in assertion
NMEA/Derived: add method ProvideAutoMacCready()
NMEA/Derived: ignore AutoMC changes smaller than 0.05 m/s

Limit the rate of changes.