Remove alcove_stats
Convert to BSD errx from erl_interface erl_err_*
Remove dependency on erl_interface/pthreads

Convert to static buffers for encoding/decoding the erlang external term
format using ei.

Use of pthreads when fork/exec is involved is risky. After a process
calls fork(), threads may be holding a lock and cause a deadlock. So the
operations that can be performed after a fork (before exec) are
basically limited to the same operations that can be done in a signal
handler. Operations that may be unsafe include malloc and the f* stream
functions.

alcove relied on erl_interface for encoding/decoding the external term
format. Internally, erl_interface uses pthreads.

Since the interesting part of alcove is the set of operations that can
be done post-fork and pre-exec, remove the dependency on erl_interface. The
change was done manually and was pretty massive for something done
by hand. alcove compiles and all the tests pass but there will be
regressions, especially considering not all calls are tested. For example,
cgroups are likely broken.

These changes have been tested only on Linux/32-bit/ARM.

This change had the benefit of simplifying the code and applying limits
to some of the inputs.

ei was used for convenience. It may be better to move to a custom
protocol or building a custom library for decoding the ETF.

ei/the term format has many problems:

* lists of small integers are encoded as strings

  A list may be magically converted to a string if the list is comprised
  of integers 0-255. Interestingly, 0 is considered to be a string even
  though strings are NULL-terminated. So [0] is encoded as a string.

  C code must catch both cases and possibly normalize the string into a
  list. Even trickier since a list is terminated by an empty list.

* integer overflows

  All ei functions dealing with static buffers take an pointer to an
  offset. This index is a signed integer which can overflow.

  Not a problem for alcove since messages are limited to lengths that can be
  represented in 2 bytes.

* buffer overflows

  The ei functions do not take a length. While the size of certain types
  (strings, binaries, atoms) can be queried using ei_get_type(), other
  types report a size of 0. Since the size of these encodings are not
  known to the caller, it is questionable what is an appropriately sized
  buffer.

The term encoding changes in this commit are sketchy and need to be
cleaned up. Some of the functions encode a complete term, others encode
at an offset and others return an allocated buffer.
Remove alcove_stats
Convert to BSD errx from erl_interface erl_err_*
Merge branch 'ei' into eix

Conflicts:
	c_src/alcove.c
	c_src/alcove_file.c
	c_src/alcove_term.c