elasticsearch: Added callback functionality to perform_request

Signed-off-by: Joe MacMahon <joe.macmahon@cern.ch>
tests: Updated tests to wait for responses properly.

* Get the Future object using a callback with a closure, then block on
  them before running assertions.

Signed-off-by: Joe MacMahon <joe.macmahon@cern.ch>