Removed broken function.

This won't work as expected, as the return code of the calling command will be set only after the function has terminated.
Only redirect STDERR, otherwise we get no LDIF output ;)
Fixed permissions
Fixed implementation errors.
Get rid of non-working logCommandOutputOnError command.