Make sure discount code exists before trying to apply it

Checks that the discount code exists before trying to apply it, otherwise `edd_get_discounted_amount()` will return `0`.

When this is then subtracted from `$price` and inverted to make `$discounted_price` here:

`$discounted_price -= $price - edd_get_discounted_amount( $discount, $price );`

 it'll always equal the negative value of the price giving the user a 100% discount.