Ticket 47892 - Fix remaining compiler warnings

Description:  Fix the remaining compiler warnings from ds/lib/base/system.cpp

https://fedorahosted.org/389/ticket/47892

Reviewed by: nhosoi(Thanks!)
Ticket #47919 - ldbm_back_modify SLAPI_PLUGIN_BE_PRE_MODIFY_FN does not return even if one of the preop plugins fails.

Bug Description: In ldbm_back_modify, if one of the be_preop plugins
called at SLAPI_PLUGIN_BE_PRE_MODIFY_FN fail, ldbm_back_modify does
not return there but go to the real modify operation.

Fix Description: If an error is returned from be_preop plugins in
ldbm_back_modify, it returns the error there and does not proceed
the modify operation.

https://fedorahosted.org/389/ticket/47919

Reviewed by mreynolds@redhat.com (Thank you, Mark!!)
Ticket 47899: Fix slapi_td_plugin_lock_init prototype

Description: FreeIPA compilation gives a GCC warning in a 389-ds header:
warning: function declaration isn't a prototype
Fixing the warning as follows:
  -int slapi_td_plugin_lock_init();
  +int slapi_td_plugin_lock_init(void);
Note: () takes any number of arguments, while (void) takes none.
Ticket #47912 - Proper handling of "No original_tombstone for changenumber" errors

Bug Description: As analyzed by Ludwig Krispen in
  https://fedorahosted.org/389/ticket/47912#comment:1,
an error message "No original_tombstone for ..." is always logged
if original_tombstone does not exist.  It should be just for the
case create_tombstone_entry.

Fix Description: This patch place the original_tombstone handling
in "if (create_tombstone_entry)" clause.

https://fedorahosted.org/389/ticket/47912

Reviewed by lkrispen@redhat.com (Thank you, Ludwig!!)
Ticket 47920: Encoding of SearchResultEntry is missing tag

Bug Description:
	The encoding of the PreReadControl,PostReadControl does not
	contain the tag (LDAP_RES_SEARCH_ENTRY = constructed+application).

	The server should return SearchResultEntry (http://tools.ietf.org/html/rfc4527 3.1 & 3.2)
	That is
		SearchResultEntry ::= [APPLICATION 4] SEQUENCE {
			     objectName      LDAPDN,
			     attributes      PartialAttributeList }
Fix Description:
	Add the tag to the ber encoding

https://fedorahosted.org/389/ticket/47920

Reviewed by: Noriko (thanks !)

Platforms tested: F17

Flag Day: no

Doc impact: no
Ticket #47897 - Need to move slapi_pblock_set(pb, SLAPI_MODRDN_EXISTING_ENTRY, original_entry->ep_entry) prior to original_entry overwritten

Bug Description: In the DEADLOCK retry code in ldbm_back_modrdn,
SLAPI_MODRDN_EXISTING_ENTRY in pblock is reset with the new entry
to be renamed.  The location of the setting entry was inappropriate,
thus instead of the entry, but its backup is set in pblock.

Fix Description: Moving the slapi_pblock_set(SLAPI_MODRDN_EXISTING_
ENTRY) to the correct position.

Plus, in the DEADLOCK retry code, original_entry is duplicated and
used for the next loop.  The source of the duplication has to be
the clean entry before updated in the backend code, but in ldbm_add,
ldbm_modify, and ldbm_modrdn, the current entry was duplicated and
set to the original entry, which could have been updated in the
previous loop.  This patch fixes it, as well.

https://fedorahosted.org/389/ticket/47897

Reviewed by tbordaz@redhat.com (Thank you, Theirry!!)
Ticket #47922 - dynamically added macro aci is not evaluated on the fly

Bug Description: When macro aci is dynamically added and if the aci's
macro target dn is not normalized, the following operation that requires
the aci could fail with Insufficient access since matching the target dn
and the macro target dn fails since the code expects normalized macro
target dn.

Fix Description: Before setting the macro target dn, process the dn by
slapi_create_dn_string_case.

https://fedorahosted.org/389/ticket/47922

Reviewed by lkrispen@redhat.com and rmeggins@redhat.com (Thank you, Ludwig and Rich!!)