apmanager: specify control interface path for hostapd

Configure control interface path for hostapd. This allows the apmanager
daemon to communicate with hostapd through the control interface, mainly
for event notifications.

Also added EventDispatcher class for dispatching tasks to the current message
loop, and uses MockEventDispatcher for unittests.

BUG=chromium:431759
TEST=USE="asan clang" FEATURES=test emerge-$BOARD apmanager
Manual Test:
1. Start AP service on x86 (x86-alex), amd64 (stumpy), and arm (peach_pit)
   platforms, verify control interface file is created for the network
   interface that's used for hostapd. For example,
   "/var/run/apmanager/hostapd/ctrl_iface/uap0"

Change-Id: Id4567021ca0b5ec4cb9d7804583cc6b88379a74f
Reviewed-on: https://chromium-review.googlesource.com/240031
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Zeping Qiu <zqiu@chromium.org>
Trybot-Ready: Zeping Qiu <zqiu@chromium.org>
Tested-by: Zeping Qiu <zqiu@chromium.org>
12 files changed