[connman] Increase maximum size of stats files.

The default maximum size of the stats files was 16 kB. However, now
that each record is approximately twice as big (due to the change from
32 bit to 64 bit data types) the number of records which can be stored
has halved. To compensate increase the default maximum size to 32 kB.
[connman] Fix erroneous data counters when roaming.

The home and roaming pointers in the stats file header are not updated
when summarising the history file. This can result in the home or
roaming pointer pointing to an invalid record. Fixed by setting both
values to UINT_MAX (invalid) when the history file is updated.
[connman] check service ID validity

storage: check service ID validity

Connman service ID is used, in the form it is read from storage, as
part of D-Bus path in connmand's D-Bus API. If the path constructed
using the service ID does not conform to D-Bus specifications, D-Bus
library assertion will cause connmand to exit; on restart the same
invalid ID is read from the storage and the assertion is triggered
again.

I experienced a connmand restart loop because some apparently
wispr-related memory corruption caused a service ID with binary
characters to be stored on disk. While that bug should be fixed also,
sanity-checking the service ID does not harm.
[connman] do not start wifi scan if network is associating
Merge pull request #78 from lpotter/master

[connman] do not start wifi scan if network is associating
Merge pull request #79 from tigeli/master

Change the threshold for background scanning from -45 to -65
Merge pull request #76 from amccarthy/master

Data counter fixes
[connman] fix scan when no networks.
Merge pull request #80 from lpotter/master

[connman] fix scan when no networks.
Merge pull request #77 from hmallat/sanity-check-service-id

[connman] check service ID validity
[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] ofono: set_property_calls table was destroyed too early

It should be kept alive until after we made all the calls that can call us back.
Otherwise we may end up accessing hashtable that has already been destroyed.
[connman] fix crash and report error properly

connect_service() calls __connman_service_connect() which may in turn call
reply_pending() which unrefs service->pending and sets it to NULL. Therefore,
connect_service() needs to check service->pending for NULL prior to calling
dbus_message_unref() on it.

Also, __connman_error_failed() expects a positive error code.
Merge pull request #87 from monich/service_pending_crash

service: fix crash and report error properly
Merge pull request #86 from monich/remove_modem_crash

ofono: set_property_calls table was destroyed too early