AthenaMonitoringKernel: fix memory leak on deregistration
Second attempt of fixing the memory leak on histogram deregistration. This time correctly identifying the offline/online use-cases. Fixes crash ( ATR-30293) seen in the HLT after !74789 (merged).