Added simple locking daemon

The locking daemon is automatically spawned by clients when they open a schema.
There is some race condition and permission trouble when creating the listening
UNIX socket, which will need to be resolved.

The current system is designed to support three levels of locking: global,
table and range.  These are the rules:

  * A global lock cannot be held at the same time as any other lock.
  * A table lock cannot be held at the same time as any other lock on that
    table.
  * A range lock cannot be held at the same time as locks for overlapping
    ranges on the same column, nor at the sime time as range locks for other
    columns in the same table.

Locks are meant to be grabbed at the start of a transaction, except read-only
transactions.  The query processor should ensure that the transaction any
query, including SELECTs, fall outside the scope of the currently held locks.
This will ensure serializability.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>