core: fix medium insert; do not send medium delete notification if nothing is deleted.