Always downcase promo code on promo.activate [Fixes #3272]

Old spree databases might have promo codes with mixed cases which would
make coupon codes case sensitive

e.g. "nocode" == "noCode" ("nocode" entered by user would be invalid)
allow shipping address with country or state attributes when creating
orders through the api
Only create promo items if order is eligible

Add a doc block to CreateLineItem.perform block to explain why it's not
suitable for Add to Cart events and explained another possible caveat

[Fixes #3275]
[api] Add show action to Checkouts API
Fix race condition with product permalink generation

See this comment for a nice script on how to reproduce: https://github.com/spree/spree/issues/2714#issuecomment-19798918

Product creation in the API will now automatically be retried if an ActiveRecord::RecordNotUnique exception is thrown. This would be thrown due to the unique index which now exists on the spree_products table.

This commit also adds similar unique indexes to the orders, shipments and stock_transfers tables, although I was unable to get these showing similar behaviour to the products API in my testing.

Fixes #2714