Don't crash when applying an alloc_size attribute on a K&R function.
When a parameter list in a C function has an error, recover by forming a K&R function,
instead of a non-function type.
In LookupResult::resolveKind(), when handling multiple found declarations, ignore invalid declarations.

This reduces the "ambiguous reference" errors (which are rather strange in C/ObjC) and fixes an assertion hit
with an invalid code test case.