Fix simple application

Don't expect the types to be inferred immediately. If the types of the
arguments are not solved immediately, push their holes to the end of the
hole queue rather than failing with a Can't Infer Type error.

Also fix for linear patterns - don't erase a repeated name in a function
application.
Remember to save deferred definition types in IBC

Partial fix for #955 (still need to save missing case information,
though this is less important)