Reorder initialisation statements.
Refactored timer code
Scan window: range information is constant during scan

The interface name can only be changed through the configuration
screen (F7), hence the interface name does not change during scan.
Hence the range information needs to only be populated once, during
initialisation, and not on each individual scan.
Scan window: use same formatting for 2 and 5 GHz
Scan window: refactor error handling

Move checking of those errors that do not need to be checked on each scan
(e.g. no permission, interface not enabled) to window initialisation code.
Scan window: reduce ranking list at bottom

Showing 5 most/least crowded channels can clutter the screen, use 3.
Scan window: revert 8466320b8e69e2

It is possible for the interface to migrate from up to down during
a scan (e.g. when wpa_supplicant) shuts down, hence allow for this.
Scan window: separate gathering data from display

This is needed to split data gathering into a separate thread later.
Scan window: use thread instead of child process for scanning

This fixes a bug reported by Nick Warne. The long-running scan process was
implemented via fork(), both child and parent process having access to the
terminal. This causes problems with more recent versions of the ncurses
library (first pointed out by Nick on Slackware 14.1, then found to also
appear on Debian jessie).

The present implementation now uses a pthread, so that all terminal interaction
is done by the main process (the thread only does the scanning).
Configure: do not check for standard functions

This removes checks for C functions that are part of C99 and/or POSIX.
Scan window: split scan-thread and display code
Scan window: precompute the channel directly after scan
Reformat version information.
Scan window: precompute level information directly after scan