[connman] Fix service reference counting when online check fails.
wifi: cancel autoscan timeout when removing device

Usually autoscan is cancelled when the device is disabled, but when
wpa_supplicant leaves D-Bus while device has an ongoing power request,
__connman_device_disable() will return early and thus autoscan timeout
isn't cleared. The timeout callback may then access released memory
when it's activated.

Add stop_autoscan() call to wifi_remove() to make sure there are no
pending timeouts when the autoscan struct is released.

[connman] wifi: cancel autoscan timeout when removing device
Merge pull request #63 from hmallat/cancel-autoscan-on-wifi-removal

wifi: cancel autoscan timeout when removing device
Merge pull request #62 from amccarthy/ghost-services

[connman] Fix service reference counting when online check fails.
service: helper function for sorting services

Created a helper function to sort service list, to shorten the code
slightly and to ensure null pointer check is always done before using
the list pointer.

[connman] service: helper function for sorting services
Merge pull request #64 from hmallat/service-list-sorting-fix

service: helper function for sorting services
[connman] allow autoconnect when service is in failure state.
Merge pull request #65 from lpotter/autoconnect

[connman] allow autoconnect when service is in failure state.
[connman] fix NULL pointer crash connman_device_set_disconnected
(device=0x0, disconnected=<optimized out>) at src/device.c:765