core: Enable notifications to be sent on set/unset

Change notify to handle unset by passing only the old value.
Introduce BuxtonList

BuxtonList provides an intelligent linked list. Unlike standard linked
list implementations, it tracks both head and tail, as well as its
own length. This allows for much faster append operations, enabling
the list to remain in its intended order.

A BuxtonList is not initially allocated, rather you use a pointer to
a BuxtonList pointer (double pointer) to initialise. It can be initialised
by appending to a NULL double-pointer. Given that append is just as
fast as prepend, either operation can be used without sacrifice.

BuxtonList also supports automatic freeing of members, which can be done
simply by using the buxton_list_free_all function, or one of the
shorthand attribute definitions (such as _cleanup_list_all)

Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>
test/check_shared_lib: Add BuxtonList test suite (extensive)

This test is purposefully designed to test both the correctness
and performance of BuxtonList, resulting in 1 million elements
being added to a BuxtonList.

Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>
core: Convert notification lists to BuxtonList

BuxtonList provides a managed solution to quickly and easily store
clients registered for notifications in the order they registered.
The previous map implemenation proved to be buggy, and broke
client notification support.

With this commit, one can observe that they can open as many
bxt_gtk_client instances as they can, and notifications will be sent
to all of the clients instantly.

Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>
Change message protocol to add a message ID field

The client will now send messages with a message ID to the server that
the server will then put in responses to the client. This is intended
to be transparent to the client as a mechanism to implement callback
functions per message.
Add FIXME
Don't check label on client test

Clients do not care about the label status and shouldn't depend on it
being set any particular way.
core: Change structure for daemon responses

All client calls to the daemon (aside from list keys) now return the
key being acted upon. This change is for callbacks to be generic per
API function without the client needing pass the key it used itself.
libbuxton: Add hashmap initialization and locking

This is to allow multithreaded clients to safely update the callback
hashtables. This also changes client open to only allow one open per
process.
libbuxton: Add callback functions to API definitions

Enable the client to pass callback functions to the API.
shared: Add check for null array in buxton_array_free
shared: Register callback functions

Add callback functions to callbacks hash that will be checked in
buxton_wire_get_response. Also check hash every time we get a response
in order to purge timed out responses.
shared: Indentation fixes
shared: Add _write utility function to handle EAGAIN

Will be used for writing to the O_NONBLOCK fd that we will switch to
using.
core: Configure daemon socket to use O_NONBLOCK

Also use _write to write messages to the client.
libbuxton: Hook in callback support

Change API to support callback functions.
Add FIXME
Enable O_NONBLOCK for the client using libbuxton
test: Correct test to handle key being returned from set

Signed-off-by: William Douglas <william.douglas@intel.com>
test: Free string after test not before

Signed-off-by: William Douglas <william.douglas@intel.com>