Update the white or black list when editing an entry

Must be careful to re-select the logically same entry even after it actually
has been removed and the edited on inserted.

Change-Id: Id19f7845fadbc018affab7a6cb6b421ed9170297