Fix completion error handling.

complete is designed to return a generator. It is returning a generator from
another helper function, therefore it is not capable of catching exceptions
raised in those generators. These exceptions will be raised upon calling next()
so move the handling of CompletionError into the decorator which calls next().
Also catch exceptions thrown by normal functions.

CompletionError exceptions can be thrown by generators when next()
is called, or by simple functions (i.e. those returning a list) at
the point of call (i.e. before iter() is applied). Catch both
cases.