edbe6a6f74
When an mjpResourceProvider's open callback returns 0 (failure), MuJoCo does not invoke the corresponding close callback. Previously, several resource provider implementations allocated heap memory or system file handles before encountering an error, failing to clean them up before returning 0. This change addresses these leaks across the codebase and clarifies the API contract. PiperOrigin-RevId: 929803942 Change-Id: Ib7344033726895cdf037a8d9356ffc183c78c2d3