[SofaPython] fix memory leak
[SofaPython] fix memory leak

Adapted from a patch from Neil Forrest (SenseGraphics)


Former-commit-id: 75ed9f2eaa7e76477376d42b536710ab735e5a44
Anatoscope/sofa,hdeling/sofa,hdeling/sofa,hdeling/sofa,Anatoscope/sofa,FabienPean/sofa,hdeling/sofa,FabienPean/sofa,Anatoscope/sofa,FabienPean/sofa,FabienPean/sofa,Anatoscope/sofa,FabienPean/sofa,Anatoscope/sofa,hdeling/sofa,hdeling/sofa,FabienPean/sofa,Anatoscope/sofa,Anatoscope/sofa,Anatoscope/sofa,FabienPean/sofa,FabienPean/sofa,FabienPean/sofa,hdeling/sofa,FabienPean/sofa,hdeling/sofa,hdeling/sofa,hdeling/sofa,Anatoscope/sofa