Save the currently edited device when clicking on ok and apply in the preferences dialog.