Correct an error that triggers a SEGV for some anchor constellations

Given sufficiently many anchors of which a subset is on a line,
it may happen that only anchors on this line are selected. Then,
llsq_run returns nan coordinates which trigger a segmentation
violation.

Additionally, I optimised the selection of the median.
Silence some warnings.