fail, PASS_ONLY and PASS_QUIETLY

I have incread the complexity of the pass/fail system in 0unit so that we can
have a chance to clean up after our errors.  When 'CHK' fails, it does a "goto
fail".   We have thus have four ways of ending a test function

        PASS()          -- prints a success message and returns 1.  No cleanup is done
                           in the event of failure.

        PASS_QUIETLY()  -- As PASS(), but it doesn't print a message.  Funtions using
                           this should be called chk_xyz rather than test_xyz.

        PASS_ONLY()     -- Like PASS(), but a failure handler is required.  This is
                           in the form

test_something()
{
        .
        .
        .
        checks
        .
        .
        .

PASS_ONLY();
fail:
        ... clean up after failure of any check ...
}
BUGFIX (elm): error cleanup methods only get the `data`

This is because error cleanup methods are only supposed to delete the `data`
member of the error.  free() is now a valid cleanup function, and
merror_cleanup has been deleted.
ELM: creating a sys_error (including IO_ERROR) always resets errno.

This is because it is common for sys_errors to package up errno.
0unit: refactoring, "chk" and "wrn" can now take varargs.
WRN and FAIL: these warn or fail, but print messages.
Merge branch 'ftr/namespace-reform' into ftr/from-lim

ftr/from-lim are changes made when lim was part of another application.

There (commit:6d440ef) we changed the meaning of the error cleanup
functions.  But namespace-reform stomps the same code in order to rename
some symbols.  This conflict has been fixed.

Conflicts:
	elm.c
Merge branch 'ftr/elm-blackbox-tests' into ftr/from-lim

ftr/from-lim are changes made when lim was part of another application.

There we decided that silently-passing tests should use "PASS_QUIETLY"
rather than "return 1".  However  in elm-blackbox-tests, the relevant
functions moved from one file to another.  The changes have been
re-applied by hand.

Conflicts:
	elm.c
VERSION: 0.5. -> 0.5..

.. means "post release", which servers no real purpose except to make
sure thack chkrel.sh does not accidentally pass.
BUGFIX: CHK(expr) will no tolerate '%' in `expr`.

Previously, the stringified version of expr was used as a printf-like
format string.  Now it is treated literally, because it is  used as a
"%s" argument.
Merge branch 'master' into ftr/from-lim
elm.h -- post scan of comments.

Scanning the comments to see if the merge had obsoleted any of them.  I
don't think that has happened.  But I fixed various sundry errors.
BUGFIX: make clean delete  the correct .o files.

We now actually resepect $(BUILD_DIR)
*_log are constants, not variables.

These pointers used to be variables, they are now macros which directly
dereference underlying static objects.  This means you can now use these log
pointers in static initialisers.
Loggers have refcounts (static ones can be reffed)

Loggers now maintian have a refcount object.  For loggers created with
new_logger this is a true refcount which can be incremented with `ref_logger`.
`destroy_logger` will decrement the refcount and only destroy the logger on the
last ref.

For the four static loggers, `destroy_logger` and `ref_logger` are no-ops which
can safely be called any number of times.
SYS_ERROR and IO_ERROR take fprintf-like  varargs.

The varargs are inserted in msg_prefix: the explanation string that is printed
before errno/strerror.
sys_error unpacks SYS_ERROR objects (and IO_ERROR)

From the comments:

/* You can unpack a SYS_ERROR (or IO_ERROR) with: */
extern int sys_error(Error *e, char **zname, char **zmsg);
/*
   If `e` is NULL, sys_error returns zero, if `e` points to an error OTHER than
   SYS_ERROR, it returns -1; in both these cases it ignores zname and zmasg.
   Otherwise returns errno; if zname != NULL, *zname is the filename (if any),
   if zmsg != NULL *zmsg is the same as strerror(returned errno).  Both strings
   are returned in free()'able buffers.
*/
BUGIX: destroy_error is now a nop on NULL input.

It has long been our convention that destroy_xyz does nothing if its argument
is NULL.  Finally, destroy_error comes to the party.
keep_first_error keeps one error of two.

From the comments:
/*
  Sometimes you want to push through a sequence of operations that might fail,
  and only report one of the errors (usually the first).  A helper for this is:
*/
extern Error *keep_first_error(Error *one, Error *two);
/*
  This function returns `one` unless it is NULL and two is not-NULL.  Any
  unused error is silently destroyed.
*/
errors: some assistance for custom error makers.

We have improved the commentary about how to make your own error types.  We
also made it easier to re-use the message error to make your own very similar
type.  This required us to expose a bit more interface, in particular:

        error_fwrite: is now public, so that you can use it in your own method
                      table.

        init_error_v: is a va_args form of init_error, use it as a "super"
                      constructor.
BUG: untouched ptr