Ticket #47693 - Environment variables are not passed when DS is started via service

Description:
The previous commit 57199b34c9cbe4a703e537633fbe6beab9a94e81
contained a cherry-pick error.
Replaced CFG_ONOFF_LOCK_WRITE with CFG_LOCK_WRITE, and
         CFG_ONOFF_UNLOCK_WRITE with CFG_UNLOCK_WRITE
Ticket #47677 - Size returned by slapi_entry_size is not accurate

Description: slapi_entry_size calculating the entry size had issues.
. To calculate the Slapi_DN size, local function slapi_dn_size was used.
  Local slapi_dn_size missed to count the raw dn length.  This patch
  replaces slapi_dn_size with (slapi_sdn_get_size - sizeof(Slapi_DN)).
. slapi_entry_size counted Slapi_RDN twice.
. slapi_entry_size did not count the size of e_virtual_lock, e_aux_attrs
  and e_extension.

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

Reviewed by rmeggins@redhat.com (Thank you, Rich!!)
(cherry picked from commit b1e4cdf5131a1730c9d3674b19d0e2a0670286e7)
(cherry picked from commit 7b0842923c54333bc14539d72e999cbe30814386)
(cherry picked from commit baa3df4e846526f520d3d3533e2611045c243771)
Ticket #47692 single valued attribute replicated ADD does not work

https://fedorahosted.org/389/ticket/47692
Reviewed by: nhosoi,lkrispenz (Thanks!)
Branch: 389-ds-base-1.2.11
Fix Description: Add special corner case handling for the case where
- attr is deleted with vdcsn and adcsn CSN1
- attr vucsn is NULL
- incoming mod/add has CSN2 where CSN2 > CSN1
in this case, just keep the new mod/add value as the present value.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 59941ea23b6f288617ba1e6ce58238fa59266c9f)
(cherry picked from commit 01a112121e80505021d0a18afa899b5c46180797)
(cherry picked from commit a4a46424d59a189552c1d17eed1d52218f3a95b8)
(cherry picked from commit dad08c10826896dc4e8772ec400d60e3eb0ebbb6)