Imported semi-lockless circular queue.

Author: Rusty Russel <rusty@rustcorp.com.au>
Licensed under MIT-BSD.

Extended with consumer sleep/wakeup for our use,
where we want the consumers to sleep instead of
racing for new packets.

Change-Id: I37b57befcd98e1da6a485aaf48433dc06c68fa5e
Updated networking code.

- Simplified and decoupled I/O from processing code.
- Single reader with multiple workers.
- Reader is bound to specific CPU for lowest possible latency.
- Reverted to select() instead of fdset wrapper as epoll/kqueue could
  be quite slower for a single or handful of sockets.
- Reader I/O calls are non-blocking.

General idea is:
- Reader takes free request from a rx_queue
- Receives data and pushes it to the tx_queue
- Worker processes the packets, sends answers and returns the request
  to the rx_queue

Semi lock-free queue is used for communication.
This is measured to be slightly better than singlethreading, as socket
contention could be better predicted - the reader cannot check sockets
for new events when tx_queue is full.

Change-Id: Ifc40889b355404a9e78e10d77c26cb3fc4c58386