[PATCH v5 32/35] monitor: add support for auto-deleting monitors upon close