Fix memory leak introduced by https://github.com/robotology/gazebo-yarp-plugins/commit/e7509012a41899671475f55a05c3d367392ab036