LDAP: Extract the check whether to run a POSIX check to a function
This will reduce the code duplication in the following patches and will
allow to keep all the logic on one place so that when/if we change the
code in the future, we only have to change the single place.
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Sumit Bose <sbose@redhat.com>