Fix logic when whitelisting subdomains against wp_validate_redirect().

This fixes a few logic issues from commit 8e736ef216.