This patch is based upon the Rich's patch (447020:
0001-Bug-631862-crash-delete-entries-not-in-cache-r.patch) with 2 additions:
1) entrydn attribute is always added to the entry in memory before putting
it in the entry cache, and the attribute is removed before writing the
entry to the database.
2) eliminating id2entry_ext, which was introduced to pass flags, but it is
no longer needed since only a flag ID2ENTRY_ADD_ENTRYDN was removed.