Fix NullPointerException when refreshing wifi preferences.

AccessPointPreference.refresh() is being called in different threads.
The refresh of the preference should only be updated in the main thread.
When access point updates is received not in the main thread, will post
the refreshing of the preference to the message queue to make the update
on the UI thread.

Test: auto - run monkey to verify there is no ANR or crash
      manual - go to Settings->Wifi, toggle on/off many times and verify
      there is no crash.

Change-Id: I656a70ecf2e7b9446c7b95b6b42ab19a5cc2e51c
Fixes: 30902893
(cherry picked from commit b8011dbb936df94f54bbce75282a2caf477346dc)
1 file changed