Dust formation and survival in supernova ejecta