Add a LatchCallback so that we can wait for async methods that receive callbacks
Add a LatchCallback so that we can wait for async methods that receive callbacks

In some situations, e.g. tests, booting, we need to wait for certain methods to
complete which would normally run asynchronously. Such asynchronous methods usually
take callbacks. This adds a new callback that contains a latch and can be passed
to such methods and can then be Wait()ed upon.

Change-Id: Ic40ae45b8fda86cbb07f3aa0b86d4de1e1a310e3
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1176
Tested-by: jenkins
Reviewed-by: Matteo Bertozzi <1d5ca967930bde0bdce795acbf71a5e281d2d4e5@cloudera.com>

cloudera/kudu,cloudera/kudu,andrwng/kudu,EvilMcJerkface/kudu,InspurUSA/kudu,InspurUSA/kudu,InspurUSA/kudu,InspurUSA/kudu,cloudera/kudu,andrwng/kudu,InspurUSA/kudu,andrwng/kudu,cloudera/kudu,helifu/kudu,cloudera/kudu,helifu/kudu,InspurUSA/kudu,EvilMcJerkface/kudu,EvilMcJerkface/kudu,helifu/kudu,andrwng/kudu,EvilMcJerkface/kudu,cloudera/kudu,EvilMcJerkface/kudu,EvilMcJerkface/kudu,helifu/kudu,EvilMcJerkface/kudu,helifu/kudu,helifu/kudu,helifu/kudu,andrwng/kudu,cloudera/kudu,helifu/kudu,helifu/kudu,andrwng/kudu,andrwng/kudu,InspurUSA/kudu,EvilMcJerkface/kudu,cloudera/kudu,andrwng/kudu,EvilMcJerkface/kudu,andrwng/kudu,InspurUSA/kudu,cloudera/kudu,InspurUSA/kudu