android: Add support for Valgrind in debug variants

This patch allows bluetoothd to be run with Valgrind easily in debug
variants.

For userdebug and eng variants bluetoothd is renamed to bluetoothd-main
and bluetoothd acts a wrapper to launch it either with or without
Valgrind (this is decided by value of persist.sys.bluetooth.valgrind
property).
android/README: Add Valgrind description
[travis-ci] Add configuration file
android: Fix GNU old-style struct field designator

This gives a warning on clang, that turns into an error due to -Werror.
attrib-server: Remove unnecessary fields from struct gatt_channel

These fields are only used internally by attrib_channel_attach(). The
"No GATT server found..." error message was also removed as it is also
displayed by find_gatt_server().
core: Fix associating a GAttrib to a device on incoming connections

If BlueZ is running as slave, incoming connections using ATT CID will
have a GAttrib created for them. But this GAttrib will not be assigned
to the underlying device (whose struct btd_device instance was created
in response to the Device Connected mgmt event).

This patch fixes this by assigning the GAttrib to the btd_device as soon
as a connection is first requested, which is done using attio callbacks.

Note that a new GAttrib reference is taken because attio callbacks "own"
device->attrib and thus need their own reference.
alert: Only remove attio callback after ATT request was sent

If there is a single registered attio callback, any pending ATT requests
will be dropped as soon as it is removed. This commit makes sure that
the request is sent before removing the callback.

Other places using attio callbacks may need fixing as well.
lib/sdp: Add missing Service Class ID for GAP

Also reorder last ID so the list remains ordered.
tools/sdptool: Fix output formatting

Print 8-bit and 16-bit integers with in a more readable format.
lib/sdp: Fix printing of multiple record fields

If there are multiple fields to print, sdp_record_print() was missing a
newline between entries.
gdbus: Fix memory leak

data->conn and data->path must be destroyed before freeing "data".
gdbus: Fix incorrect DBusConnection reference counting

Commit abfc2b0dd5c3e33abfdf1a815b16d492c1751c06 attempted to fix a crash
related to improper reference counting, but the main issue was that the
reference was taken only during the function call (which is usually
unnecessary for single thread), but still passed a pointer to
DBusConnection to a function that is called by the mainloop. This left a
window where the DBusConnection can be destroyed.
unit: Fix memory leaks in test-gdbus-client
unit: Fix memory leaks in gobex tests
android: Use 16-bit UUID for SDP search

These UUIDs are assigned by BT-SIG and therefore there is no need to
use full 128-bit UUIDs. This also avoids unnecessary conversion from
string representation.
android/tester: Update SDP PDU after UUID change

Now it is expected to receive a 16-bit UUID for PNP_INFO.
android/hidhost: Trivial coding style fix

Fix two lines over 80 columns.
android/client: Fix set_info command

Although this command is not implemented by BlueZ, make sure it is
callable from haltest so at least the IPC can be tested.

Also memset() the hid_info parameter to not pass uninitialized data
around.
android/test-ipc: Fix crash due to invalid ipc_register() parameter

This test checks for proper handling of invalid Service ID on a IPC
message, but it was attempting to register handlers for this invalid ID,
which on current ipc_register() implementation was causing a buffer
overrun.

The fix was to use a valid ID during registration, but still attempt to
use an invalid one when sending the message.
android: Add assertion for ID parameter in ipc_register/ipc_unregister

It is a programming error to pass a invalid ID for these functions (i.e.
the ID is statically defined on the code). Given that this ID is used
for indexing an array, adding an assertion will ensure that improper API
usage will not cause random crashes due to memory corruption.