Only check DOING_AJAX

Not sure why, but some hosts are setting the HTTP_X_REQUESTED_WITH
header for seemingly non-ajax requests. Could be MT, could be cloud
flare, we don’t know.
Merge pull request #4767 from woothemes/is-ajax-mod

Only check DOING_AJAX for AJAX requests