Check if DOING_AJAX when filtering the product list by category in the admin

Updated PR for #247 based on comments in #412