[dce] do not keep a class if only its extern fields are kept (closes #3546)