Fixed issue with leaking small amount of resources (e.g. memory) when running lots of battles in a row, e.g. when using the RobocodeEngine.