Only use wp_redirect() is $redirect variable set

Fixes https://github.com/affiliatewp/AffiliateWP/issues/284
Fix https://github.com/affiliatewp/AffiliateWP/issues/286
Merge pull request #289 from sumobi/master

Only use wp_redirect() is $redirect variable set