android/a2dp: Shutdown AVDTP gracefully

When shutting down AVDTP connection we first abort and wait for stream
to go to idle state before disconnecting signalling channel.
android/a2dp: Notify audio state on SEP close
android/hal-audio: Ignore write call when closing

We should not try to neither auto-resume nor write when state is set to
NONE as this is case when we're being closed and it's ok do ignore
write request.
android/hal-audio: Write SBC parameters to logcat
android/a2dp: Disconnect headset on IPC failure

In case audio IPC is suddenly disconnected (most likely due to crash of
mediaserver process) we should disconnect headset since it is no longer
associated with valid setup and cannot be used properly.
android/a2dp: Fix audio deregistration

Unregistering a SEP can trigger abort_cfm callback if some device is
connected thus we should free setups list after all endpoints are
unregistered to avoid error in abort_cfm due to non-existing setup.
android/build: Match compiler options used in autotools and Android.mk
android/build: Some whitespace fixes
android/haltest: Remove unneeded assignment
android/avdtp: Fix passing NULL pointer to memcpy

send_request can be called as
send_request(session, FALSE, NULL, AVDTP_DISCOVER, NULL, 0) with NULL
pointer which is passed to memcpy().
android/avdtp: Fix passing NULL pointer to memcpy

The patch fixes following clang warning:
...
profiles/audio/avdtp.c:3293:2: warning: Null pointer passed as an
argument to a 'nonnull' parameter
        memcpy(cap->data, data, length);
        ^                 ~~~~
bnep: Calculate ifindex after NULL check
android/avdtp: Fix coding style

Respect 80 columns limit.
android/hal-msg: Match handsfree structures to IPC document
android: Fix Handsfree volume command notification description
android/handsfree: Use uint16_t for buffer length in IPC messages

This will match other IPC messages format.
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
unit/avctp: Use pre-defined values instead of magic numbers
unit/avctp: Cleanup code, remove fragmentation support