Only use wp_redirect() is $redirect variable set

Fixes https://github.com/affiliatewp/AffiliateWP/issues/284