More rigorous checking of validity for mkForeign calls

Specifically, this provides a nice error if something other than a literal list is provided as a foreign type specifier to mkForeign.