safeCallback: check for existence of callback, before trying to call it