Close ColorDialog if parent pointer is destroyed
On macOS if the parent pointer is missing there is a crash, if the
parent widget is destroyed we close the colorDialog to avoid
avoid crashing when interacting with the orphan ColorDialog
BUG:413922
(cherry picked from commit a8c0351c749564544e6ed244b6defe76dc66a125)