Rewrite for multithreading

My original intention was to use GLib only for its hash table implementation,
but the work acquainted me with GLib's generic C programming facilities, so I
thought I'd try to use it throughout.

* Process incoming stats in a worker thread, and make the UDP socket blocking,
  so that control flow is linear and clear.
* Serve XML via a TCP socket service running on GLib's main event loop. The
  service will handle incoming connections using a pool of up to ten worker
  threads.
* Make dumpData reentrant.
* Use a mutex to protect access to the stats hash table.
* Use a mutex to ensure stats updates are atomic.
* Don't daemonize; let Upstart take care of that.
* Allow listen port to be specified via '--listen-port' command-line argument.

Change-Id: Iad08d752401372ab4b4e7ed3135510f5f557e1ee