Revamped safe-callback with better handling of async errors.