android: Add MTU data to Open Stream Audio IPC

MTU value for transport channel is sent in Open Stream response, which
is required to calculate number of frames which can be packed into
single media packet.

This is to avoid including GPLv2 licensed headers in Audio HAL
implementation.
android: Build Audio HAL with SBC

Build for Android requires libsbc sources to be available in
external/bluetooth/sbc. Build for host requires libsbc package to be
installed.
android/hal-audio: Rename sbc_init to avoid collision with libsbc
android/hal-audio: Initialize SBC encoder
android/hal-audio: Calculate SBC stream parameters

This patch adds necessary calculations for SBC stream parameters.

Both input and output buffers are expected to have exact amount of
data to fill single media packet (based on transport channel MTU).

Frame duration will be used to synchronize input and output streams.
android/hal-audio: Add resume to codec callbacks

Once stream is resumed it may be required to reset some state of codec,
i.e. in case of SBC we need to reset monotonic clock and frames count
which are used for synchronization.
android/hal-audio: Return proper buffer size to AudioFlinger
android/hal-audio: Read fd from Output Stream response
android/hal-audio: Add proper SBC encoding

Input and output stream is configured in a way that each input buffer
can be encoded to exactly one output buffer.

Reading from AudioFlinger is synchronized based on amounts of frames
which were expected to be sent since stream was resumed, i.e. as long
as we sent enough data we can wait for period of single media packet
before we need another buffer from input. Without synchronization
we'd receive next input buffer as soon as we process current one.
android/hal-audio: Return proper latency for stream

This patch implements get_latency() for output stream properly by
returning some meaningful value, i.e. calculated duration of single
media packet increased by fixed A2DP playback latency. This is the
same as PulseAudio does.
android/hal-audio: Fix code style
android: Move audio.a2dp.default.la build definitions

This way they are not spread in different parts of Makefile.am
tools/l2cap-tester: Fix checking for NULL test data
tools/l2cap-tester: Add basic ATT Client test case
tools/l2cap-tester: Add basic ATT Server test case
btproxy: Fix resource leak

Close file descriptors before leaving.
doc: Update l2cap-tester test count
build: Don't enable Android build for make distcheck
android/audio: Fix for loading audio lib

clock_gettime requires linking with -rt for glibc versions before 2.17
android/hal-audio: Simplify and fix locking

This fix various issues with locking like missing unlock on
audio_ipc_cmd() return or accesing audio_sk without holding lock.
close_thread is removed to simplify code and shutdown on listen_sk is
used to indicate that that handler thread should stop.