[KARAF-2449] Minor improvements on the heapdump and memory dump providers