list_to_buf: check the size of the buf

Fail early if the length of the requested buffer will not fit in the
response, rather than crashing the port if, e.g., a very large buffer is
requested and malloc fails.
Add version of ei_get_type with length checks

Check a malformed term will not cause a read past the end of the buffer.
alcove_decode_iolist: now with length checks
More decoding with length checks
alcove_list_to_buf: check length of source buf
alcove_list_to_buf: variable name clean up
Length checks for long longs and tuples
Use a wrapper around decode_iolist for strings

Make alcove_x_decode_iolist_to_string() into a wrapper around
alcove_decode_iolist(). If the iolist contains a NULL, then only the
contents up to the NULL will be returned.