Only unregister an extension if its registered