qi.anyobject: Simplifies and makes safer `metaCall` (#34829)
qi.anyobject: Simplifies and makes safer `metaCall` (#34829)

When a meta-call is asynchronous, it posts a `MFunctorCall` function object to
the eventloop. `MFunctorCall` took a raw pointer on a promise and deleted it on
its first call. It didn't subsequently set the promise pointer to null. Thus,
another call would result in a crash. On the other hand, no call would result
in a memory leak. This implementation was therefore highly unsafe and brittle.

`Promise` behaving as a shared pointer, there is no point passing a raw pointer
anymore, and `MFunctorCall` takes now a plain promise instead.

Beware that the operational behavior of `MFunctorCall` has changed, as now the
promise's resource is not freed on first call, but rather when there the last
copy of an instance is destroyed. This could paradoxically lead to a memory
leak if the `libqi` keeps these objects too long (i.e. in a "mysterious" cache,
etc.).

Change-Id: I0be0872e2c1313074dd3019b24de8c43b120168b
Reviewed-on: http://gerrit.aldebaran.lan/91550
Reviewed-by: vincent.palancher <f8ff75e1c61314c499fafa8de0d9e004e87e66b0@external.softbankrobotics.com>
Reviewed-by: jlamotte <70353e7b0c7d18b7fc75605daf0ccba69fcd3222@aldebaran.com>
Tested-by: jmonnon <8898eaf233516e520f996a244ca8a12d20f948b1@aldebaran.com>

aldebaran/libqi,aldebaran/libqi,aldebaran/libqi