Ticket 47394 - remove-ds.pl should remove /var/lock/dirsrv

Bug Description:  Once a DS instance has been created, /var/lock/dirsrv, /var/lib/dirsrv, and /var/run/dirsrv
                  are owned by the user that was specified when the instance was created. Then remove this
                  single instance, and create a new instance that runs as a different user.  The install will fail.

Fix Description:  When removing the last instance on the machine, remove the /var/lock|run|lib/dirsrv/ directories.

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

Reviewed by: richm(Thanks!)
Ticket 47371 - Some updates of "passwordgraceusertime" are useless when updating "userpassword"

Bug Description:  "passwordgraceusertime" is always reset to "0" after a password change.
                  Even if the the current value is "0".

Fix Description:  Only reset the value to "0" if the current value is not "0".

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

Reveiwed by: Noriko(Thanks!)
Ticket 47306 - execute index_add_mods only for indexed attributes

Description:  Check if the attribute being updated is actually indexed,
              before doing all the pre-index processing of the attribute/value.

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

Reviewed by: Noriko(Thanks!)
Bug 999634 - ns-slapd crash due to bogus DN

https://bugzilla.redhat.com/show_bug.cgi?id=999634
Reviewed by: ???
Branch: master
Fix Description: When the target DN is not a valid DN, the code will bypass
the initialization of unhashed_pw_smod, and attempt to call slapi_smods_done.
Depending on what memory is in the unhashed_pw_smod, if both mods and
free_mods are true, an attempt will be made to free mods or *mods and the
server will crash.  It is tricky to find the right sequence of operations
that will write the stack in such a way that both unhashed_pw_smod.mods
and unhashed_pw_smod.free_mods are set.
The fix is to just get rid of unhashed_pw_smod which is not used.
I also check this code and other operation code for similar cases, but the
rest of the code is clean.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit a3d65ac00df871675896f587b0da2c24eab961bb)
(cherry picked from commit f513bc3f955a07c9d22128b312dbbb0384192e31)