Do not crash on replicated update if replicated create has failed
Free dlg memory in case replicated create fails
(cherry picked from commit c9b39731c4669bc2d91182bb6130cc1e88286b8a)