Bug 1084257: Added event loop for file descriptors and tasks

This patch adds an event loop that is based on file-descriptor
I/O, where users add file descriptors to the event loop. The loop
monitors file descriptors using the epoll system-call interface.
When a file descriptor becomes ready, the event loop invokes a
user-supplied call-back function for handling the event.

The event-loop's first user is the task dispatcher. A task is a
pair of function and data that runs as part of the event loop
(i.e. in the same thread). The task dispatcher creates tasks and
sends them to the event loop in a thread-safe manner, using an
I/O pipe.

The implementation uses libfdio.
Bug 1084257: Added Bluetooth protocol PDU

A Packet Data Unit (PDU) for the Bluetooth protocol contains either

  1) a command,
  2) a response, or
  3) a notification.

The client sends commands to the daemon, the daemon sends responses
and notifications. Each PDU contains exactly one message.
Bug 1084257: Added PDU buffers

A PDU buffer is an internal data structure for holding PDUs during
send or receive operations.
Bug 1084257: Added service callbacks

There are 3 callbacks for each service, |register|, |unregister| and
|service_handler|. The former two are called by the Core service to
register and unregister a service on demand. The latter function is
returned by |register| and handles a command PDU for the service.
Bug 1084257: Added support for Core module

This commit adds I/O handlers for the Core module. The module is always
available and doesn't need to be initialized explicitly. It allows to
register and unregisters Bluetooth modules and configure the daemon.
Bug 1084257: Added I/O state and file-descriptor handling

This commit adds code for maintaining file-descriptors and I/O
state.
Bug 1084257: Added Bluetooth Core API and I/O

The Core interface wraps calls to bluedroid and adds some additional
checks for consistency.

The I/O code for the Bluetooth Core interface translates request
PDUs to Bluetooth calls, and Bluetooth results to reply PDUs.
Bug 1084257: Added support for the socket-profile interface

This commit adds support for the Socket module. It allows for
implementing services based on OPP.