DeviceControlDialog: Delete button for tasks and small refactoring