Improved the shutting down of OpenCOR (and, at the same time, fixed a memory releasing issue in our simulation plugin).