[connman] Check interface validity before setting regdom

Ofono may emit a signal with cellular network MCC value, resulting in
a call to wifi_set_regdom(), when the wifi_data structure has been
created but wifi->interface is still NULL. Check the pointer value
before proceeding.

The error condition is difficult to reproduce; mostly it seems to
happen when wlan tethering is active.
Merge pull request #82 from hmallat/wifi-regdom-param-check

[connman] Check interface validity before setting regdom
supplicant: Tie P2P flush D-Bus call to the interface

As the callback for the call accesses GSupplicantInterface structure,
tie the pending call to the interface pointer so that it gets cancelled
if the interface is removed.

[connman] supplicant: Tie P2P flush D-Bus call to the interface
supplicant: rewrite pending DBus call handling for properties

Property-related D-Bus calls may be pending replies when the related
GSupplicantInterface structure is cleaned up. This results in an
attempt to access already freed memory when calls complete.

Fixed by keeping a list of pending property calls, and canceling the
calls related to an interface when the interface is removed. This is a
similar change to the one made earlier for pending method calls.

[connman] supplicant: rewrite pending DBus call handling for properties
wifi: cancel pending supplicant operations when removing

If there are pending D-Bus calls made inside supplicant code when
wifi_remove() frees the wifi struct, wifi plugin callback functions
may attempt to use already released memory when the calls complete.

Fixed by cancelling any outstanding supplicant calls in wifi_remove().

[connman] wifi: cancel pending supplicant operations when removing
Merge pull request #83 from hmallat/supplicant-dbus-call-cancellation

Supplicant dbus call cancellation
[connman] refactored counters

1. Replaced stats.c with stats2.c isn't doing anything we don't need.
   The new implementation is much smaller and simpler. It also eliminates
   the global hashtable which served the purpose of associating service
   with stats - now it's done using a pointer. Roaming and home statistics
   are separated from each other.

2. Fixed the problem with service being notified about the counter
   changes for a wrong interface. The cellular service may be associated
   with different interfaces over time. In practice it's ether rmnet0 or
   rmnet1, depending on MMS context activity and whether or not one of
   those interfaces was up when connman started (when it crashes, ofono
   interfaces stay up).