Fix double free in widget dialog delete code