Calling ofono_remove_modem() while iterating the hash table is not safe
given that it can modify the table in hfp_remove().
A simple way to reproduce the problem is to pair some Bluetooth phones
and remove the Bluetooth adapter, triggering a GLib-CRITICAL assertion.
This patch just removes the update of the hash table inside
hfp_remove(). This can be safe as long as all calls to
ofono_modem_remove() are accompanied by a hash table update. The only
example of this kind right now is hfp_agent_release().
Some phones can have trouble when using the strict AT syntax parser for
HFP. So far, this has only been evidenced with the Samsung Wave, which
works fine with the permissive syntax parser.
Several other phones have been tested with the permissive parser and
seem to work OK.
If BlueZ exits during an outstanding Connect/Disconnect operation,
oFono can crash due to the pending call finishing on an already-removed
modem object.
If an adapter or device is removed any data associate should be removed,
otherwise the next time they appear/are created the drivers may not
asssociate again.