Better defensive coding for edd_is_discount_used(). #2302