Add a database constraint to make sure repositories are unique

Started working on a fix for #39.

I'm not sure if this this correct, but I think it is.

@joshk also said that we should handle build requests "failing" because of this gracefully, so we don't lose the build request. If someone could point me to how to do that, please do.