[#1612] Allow to disable resource leak detection via API