be nicer in add_foreign_key_if_not_exists to retry partially created FKs

Change-Id: I4feb4871456a0307e87fb9ac5eff623997c23102
Reviewed-on: https://gerrit.instructure.com/24535
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
treesame commit of origin/stable/2013-09-14

Treesame-Commit-Id: 002ca9be2a859e990b18cf2837c4c2bf51c70bb2