Destroy preferences dialog on close and on reset.