Start invalidator after locking pidfile

This causes the pidfile to be written as the first thing after
daemonising nslcd to minimise the race between service script completion
and pidfile being locked.
Compatibility definitions for {set,get,end}usershell()

This provides compatibility definitions for systems that don't have
these functions (some Solaris flavours).
Fix usage of AC_LANG_PROGRAM

Apparently the macro got changed a long time ago to provide a main()
definition. This bug caused the extra warning flags to not be added.
Add -Werror=implicit if compiler supports it
Fix a number of compiler warnings

This includes a number of small fixes for issues that were formerly
masked by the incorrect AC_LANG_PROGRAM check.
Portability fixes to environment tests

This mostly tries to reduce the influences of the test environment
(local users and groups) on the tests. This uses another username
(vsefcovic) in the PAM tests instead of the user arthur to avoid clashes
with existing users.

The PAM tests are skipped if passwd claims that it cannot modify LDAP
passwords (for FreeBSD).