[sensors] Introduce asynchronous way to create sensors.

As long as sensors implementation on Linux/ChromeOS will
be based on reading from files (sensors' files are located
in /sys/dev/iio/devices), asynchronous way of creating
sensors is introduced with this patch.

To be more specific, the asynchronous path is needed because
sensors' existence will be checked by blocking IO methods in
case of Linux/ChromeOS and in order to be able to say
whether a sensor exists or not, asynchronous path will be
used.

In case of Android and Mac, callbacks will be
called immediately as soon as a sensor manager in Android or
IOServiceGetMatchingService in Mac returns a sensor object
or nullptr.

How it works:
As soon as a request for a new sensor is received, callbacks
are stored into a vector which is pushed into a map with a
type key and the vector itself. If no callback has been
stored before, CreateSensorInternal() method is called.
Then:
 *Linux/ChromeOS (under development): a new thread is
  created which will handle concrete sensors creation.
 *Android: when CreateSensorInternal() is called, java code
  is called and everything is handled by the sensor manager,
  which returns synchronously. Once sensor found, it is
  returned. Otherwise, nullptr is returned.
 *Mac (under development)
  https://codereview.chromium.org/2332903002/: everything
  is handled by IOServiceGetMatchingService, which returns
  synchronously.

BUG=606766

Review-Url: https://codereview.chromium.org/2368193003
Cr-Commit-Position: refs/heads/master@{#423127}
8 files changed