rctest: add automated test

adds -a option to enable automated tests. We use the -i option to define
the receiving side and the -a define the sending side:

./rctest -i hci0 -a hci1
rctest: add option to save received data to file

works only for automated test option for now
device: Add LegacyPairing and RSSI properties

These are needed for the new device discovery where we create objects
for each found device.
device: Add device_name_known convenience function
adapter: Remove Create(Paired)Device methods

These are not needed when devices get created dynamically during
discovery.
test: Update test-discovery to support the latest API
core: Create devices dynamically during discovery
adapter: Remove out of range devices tracking

With interleaved discovery the inquiry is so short that there's a good
chance of nearby devices in not showing up during some cycles. This
makes tracking "out of range" devices unreliable and it's therefore
better to remove it. Devices get their RSSI property invalidated when a
discovery cycle finishes so devices that are not found anymore can still
be easily sorted with a lower priority by UIs.
doc: Update adapter and device D-Bus APIs
gdbus: Add g_dbus_get_properties function

This function can be used to construct custom D-Bus messages containing
the properties for a specific interface on a given path.
adapter: Add DevicesFound signal
test: Update test-discovery to match new API
input: Convert to DBus.Properties
heartrate: Fix registration of notification handler

Notification handler is registered only when CCC is written during
descriptors discovery, i.e. at least one watcher is registered before
device is connected. This means there will be no handler registered in
case watcher is registered after device already connected.
This is side-effect of 74a9fc7.

This patch registers handler immediately when measurement characteristic
is discovered so it does not matter when watcher is registered.

ccc_write_cb() is reduntant in this case so it's removed.
heartrate: Remove unused measurement characteristic value handle

Since notification handler is now registered only for measurement
characteristic value handle it's no longer needed to keep this handle.
heartrate: Convert to DBus.Properties
media: Fix leaking endpoint in case of failure to register SEP

This can happen in case of AudioSink and/or AudioSource are disabled in
audio.conf.
gdbus: Fix invalid memory access during interface removal

If an interface is removed from the root path during the same mainloop
iteration that it was added we need to check for data->added before
doing the check for data->parent == NULL in the remove_interface()
function. Otherwise the added interface doesn't get removed from the
data->added list and will result in accessing freed memory:

==337== Invalid read of size 8
==337==    at 0x4F65AFA: dbus_message_iter_append_basic (in /usr/lib64/libdbus-1.so.3.7.1)
==337==    by 0x1247B5: append_interface (object.c:556)
==337==    by 0x4C8DC5C: g_slist_foreach (gslist.c:840)
==337==    by 0x1261F7: process_changes (object.c:594)
==337==    by 0x126372: generic_unregister (object.c:997)
==337==    by 0x4F69669: ??? (in /usr/lib64/libdbus-1.so.3.7.1)
==337==    by 0x4F5CE51: dbus_connection_unregister_object_path (in /usr/lib64/libdbus-1.so.3.7.1)
==337==    by 0x125E81: object_path_unref (object.c:1236)
==337==    by 0x126136: g_dbus_unregister_interface (object.c:1361)
==337==    by 0x14CDF0: service_exit (service.c:581)
==337==    by 0x177556: plugin_cleanup (plugin.c:242)
==337==    by 0x12221F: main (main.c:559)
==337==  Address 0x5bc1550 is 0 bytes inside a block of size 56 free'd
==337==    at 0x4A079AE: free (vg_replace_malloc.c:427)
==337==    by 0x4C7850E: g_free (gmem.c:252)
==337==    by 0x125DB0: remove_interface (object.c:671)
==337==    by 0x125E3B: object_path_unref (object.c:1230)
==337==    by 0x126136: g_dbus_unregister_interface (object.c:1361)
==337==    by 0x14CDF0: service_exit (service.c:581)
==337==    by 0x177556: plugin_cleanup (plugin.c:242)
==337==    by 0x12221F: main (main.c:559)
core: Add timer for removing temporary discovered device objects
TODO: Mark CreateDevice/CreatePairedDevice removal as done