Delete local references as soon as possible
Delete local references as soon as possible

To limit the number of simultaneous local references, delete them when
possible.

This mitigates the problem of local reference table overflow (max=512 on
Android).

Change-Id: I4a8fa60755fb2018201d060ebbe07ef25bfc3432
Reviewed-on: http://gerrit.aldebaran.lan/70567
Reviewed-by: epinault <1abfa0def69a0dac55855768c5bb3267b3ee08b8@aldebaran-robotics.com>
Tested-by: gerrit
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>

aldebaran/libqi-java,aldebaran/libqi-java,aldebaran/libqi-java