core: Fix open descriptor at exit

==2760== Open pf-31 socket 22:
==2760==    at 0x3CA42F2877: socket (syscall-template.S:82)
==2760==    by 0x44B5E8: create_io (btio.c:1347)
==2760==    by 0x44BC12: bt_io_connect (btio.c:1419)
==2760==    by 0x46B6A2: connect_le (device.c:2872)
==2760==    by 0x46D0CD: pair_device (device.c:1603)
core: Remove different flow for BLE device Connect

GATT based profiles and BR/EDR profile should implement the same
behaviour when implementing the generic method Connect(). This patch
removes the ATT connection attempt from the core, the implementation
in the gatt.c using btd_service abstraction should be implemented later.
core: Remove ATT channel reference

This patch removes the ATT GIOChannel reference from the core. The file
descriptor associated with the ATT connection should be closed
automatically when the last channel watch reference is dropped.
core: Remove btio dependency from device.c

btio adds an internal GIOChannel watch, forcing users to shutdown the
channel instead of control disconnection based on references.
gatt: Trigger attribute discovery if storage is not found

This approach will allow to keep the compatibility with previously
bonded devices created using the old attribute storage format.
gatt: Store the attributes when discovery finishes

This patch avoid excessive GKeyFile access writting all the attributes
in one shoot only.
gatt: Unify attributes creation

This patch reverts the initial functions having a common function to
create attributes from storage or create them dinamically when the
attributes are being discovered.
gatt: Fix memory leak of g_key_file_to_data

==16007==    at 0x4A08A0E: realloc (vg_replace_malloc.c:662)
==16007==    by 0x3CA5E4D4A6: g_realloc (gmem.c:224)
==16007==    by 0x3CA5E65176: g_string_maybe_expand (gstring.c:102)
==16007==    by 0x3CA5E66524: g_string_append_vprintf (gstring.c:1132)
==16007==    by 0x3CA5E66726: g_string_append_printf (gstring.c:1232)
==16007==    by 0x3CA5E40F7C: g_key_file_to_data (gkeyfile.c:1486)
==16007==    by 0x4670DE: database_store (gatt.c:1389)
gatt: Store the handles on hex format
core: Add a way to get a device's address type
gatt: Add a default connect method

This btd_gatt_connect() will be used by profiles when they want to
establish a GATT connection.
gatt: Document why we check for repeated attributes

It may be possible that the response for FindInformation includes
attributes that already present in the device database.
profiles/gatt: Fix trying to read attributes when not connected

Now that we are using the btd_service infrastructure, we are able
to only try to read the attributes when we are notified that we are
connected.
profiles/gatt: Set auto_connect for GATT profile
gatt: Add btd_gatt_disconnect()

This will be set by profiles as their .disconnect() functions, so
the GATT core can do the right thing when the profiles needs to
disconnect.
profiles/gatt: Add a disconnect() function

As we have a .connect() functions it also makes sense to have a
.disconnect() function.
gatt: Separate btd_gatt_connect() into two functions

We need to have separate functions to connect to GATT devices, because
in some cases we don't have associated services with that device.
gatt: Connect to the device before trying to discover attributes

When calling Device1.Connect() on a non-bonded device, we need to
establish a connection before trying to discover the attributes
of a device.
device: Fix connecting before probe
gatt: Fix wrong parameters to channel_remove

channel_remove should receive a btd_device, not a GAttrib pointer.