Remove dialog from DOM while not shown.