core: Fix crash when registering an invalid profile

When a uuid string is sent and it doesn't indentify a profile
(bt_name2string() returns NULL), bluetoothd crash later when trying to
access the external profile uuid field.

Valgrind log:

bluetoothd[3986]: src/profile.c:register_profile() sender :1.492
==3986== Invalid read of size 1
==3986==    at 0x4C2ACA4: strcasecmp (mc_replace_strmem.c:583)
==3986==    by 0x4656F0: register_profile (profile.c:1920)
==3986==    by 0x40CFF0: process_message.isra.4 (object.c:258)
==3986==    by 0x517C9E5: _dbus_object_tree_dispatch_and_unlock (in /usr/lib64/libdbus-1.so.3.7.2)
==3986==    by 0x5167349: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.7.2)
==3986==    by 0x40AB77: message_dispatch (mainloop.c:76)
==3986==    by 0x4E77BCA: g_timeout_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==3986==    by 0x4E77044: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==3986==    by 0x4E77377: g_main_context_iterate.isra.24 (in /usr/lib64/libglib-2.0.so.0.3400.2)
==3986==    by 0x4E77771: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
==3986==    by 0x40A3AE: main (main.c:583)
==3986==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==3986==
==3986==
==3986== Process terminating with default action of signal 11 (SIGSEGV)
==3986==  Access not within mapped region at address 0x0
==3986==    at 0x4C2ACA4: strcasecmp (mc_replace_strmem.c:583)
==3986==    by 0x4656F0: register_profile (profile.c:1920)
==3986==    by 0x40CFF0: process_message.isra.4 (object.c:258)
==3986==    by 0x517C9E5: _dbus_object_tree_dispatch_and_unlock (in /usr/lib64/libdbus-1.so.3.7.2)
==3986==    by 0x5167349: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.7.2)
==3986==    by 0x40AB77: message_dispatch (mainloop.c:76)
==3986==    by 0x4E77BCA: g_timeout_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==3986==    by 0x4E77044: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==3986==    by 0x4E77377: g_main_context_iterate.isra.24 (in /usr/lib64/libglib-2.0.so.0.3400.2)
==3986==    by 0x4E77771: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
==3986==    by 0x40A3AE: main (main.c:583)
==3986==  If you believe this happened as a result of a stack
==3986==  overflow in your program's main thread (unlikely but
==3986==  possible), you can try to increase the size of the
==3986==  main thread stack using the --main-stacksize= flag.
==3986==  The main thread stack size used in this run was 8388608.
==3986==
gdbus: Always unreference the message in g_dbus_send_message()

A quick fix on g_dbus_send_message(), if check_signal() fails it returns
FALSE without unreferencing the message as it should. This patch fixes
it.
configure.ac: call AC_SUBST unconditionally with --with-* options

Call AC_SUBST unconditionally when specifying --with-* options,
otherwise options like --with-dbusconfdir=DIR or --with-udevdir=DIR have
no effect.

Before this change, configuring with:

  $ mkdir build
  $ ./configure --disable-systemd \
                --prefix=$(pwd)/build \
                --with-dbusconfdir=$(pwd)/build/etc

resulted in the option value to be ignored at "make install" time, with
this error:

  /bin/mkdir: cannot create directory '/dbus-1/system.d': Permission denied

This is what was going on in configure.ac:

  # define the option
  AC_ARG_WITH([dbusconfdir] ... [path_dbusconfdir=${withval}])

  # when --with-dbusconfdir is NOT used
  if (test -z "${path_dbusconfdir}"); then
    ...

    # define the config dir automatically
    path_dbusconfdir="`$PKG_CONFIG --variable=sysconfdir dbus-1`"

    ...

    # set DBUS_CONFDIR
    AC_SUBST(DBUS_CONFDIR, [${path_dbusconfdir}])
  endif

when --with-dbusconfdir=SOMEDIR was used the test above failed, and the
result was that ${path_dbusconfdir} was indeed defined as manually
specified, but DBUS_CONFDIR was not, and the latter was going to be used
in Makefile.am:

  dbusdir = @DBUS_CONFDIR@/dbus-1/system.d

The failure in mkdir can be exposed by the use of the "--prefix" option
and by running "make install" as a normal user; when running "make
install" with the root user /dbus-1/system.d would be happily (and
wrongly) created.

By always setting variables relative to --with-* options (like
DBUS_CONFDIR) the cases when --with-someoption=SOMEDIR are used get
covered.
configure.ac: call AC_SUBST(*_CFLAGS) and AC_SUBST(*_LIBS) only when needed

Bring AC_SUBST(*_CFLAGS) and AC_SUBST(*_LIBS) in the same block of the
corresponding PKG_CHECK_MODULES() call.

Having these variables defined outside of the if tests is more than what
is needed as the corresponding PKG_CHECK_MODULES() might not have been
called at all there.

This is the same logic already used for USB_CFLAGS and USB_LIBS.
lib: Update list of company identifiers
build: Update library version
Release 5.3
attrib: Avoid passing raw PDU to Exchange MTU callback

By centralizing the PDU parsing and validation internally to GATT API,
the callbacks become simpler.
unit: Add test for gatt_exchange_mtu()

The new unit/test-gatt.c file will contain tests for GATT API
implemented in attrib/gatt.{c,h}.