clients & tests: Unify multiple definitions of x*alloc and related functions

Direct fail_on_null calls now produce output like:

    [weston-info] clients/weston-info.c:714: out of memory

xmalloc, et al produce output on failure like:

    [weston-info] out of memory (-1)

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
diff --git a/clients/ivi-shell-user-interface.c b/clients/ivi-shell-user-interface.c
index 1349c73..db64f19 100644
--- a/clients/ivi-shell-user-interface.c
+++ b/clients/ivi-shell-user-interface.c
@@ -40,6 +40,7 @@
 #include "shared/config-parser.h"
 #include "shared/helpers.h"
 #include "shared/os-compatibility.h"
+#include "shared/xalloc.h"
 #include "shared/zalloc.h"
 #include "ivi-application-client-protocol.h"
 #include "ivi-hmi-controller-client-protocol.h"
@@ -164,18 +165,6 @@
 };
 
 static void *
-fail_on_null(void *p, size_t size, char *file, int32_t line)
-{
-	if (size && !p) {
-		fprintf(stderr, "%s(%d) %zd: out of memory\n",
-			file, line, size);
-		exit(EXIT_FAILURE);
-	}
-
-	return p;
-}
-
-static void *
 mem_alloc(size_t size, char *file, int32_t line)
 {
 	return fail_on_null(zalloc(size), size, file, line);