FileHistory: fix leak of objects stored in fEvents[] - memory leak and open files leak
Fix crash in cm_connect after cm_disconnect (thanks to Greg Christian of TRIUMF/Dragon)