s3-winbind: Move finding the domain to it's own function.