VariablesPreferences: Abort editing before deleting a row

This prevents `tableView:objectValueForTableColumn:row:` from throwing an exception (index beyond bounds) when the user deletes the last row while it is being edited.
VariablesPreferences: Make insertion of row more natural

We now insert new variables after the selected row.