Check the arity of complete listeners and yield different things

* For backwards compatibility when the listener has arity 1 the future itself will be yielded
* When the listener has arity 2 or -3 (i.e. two required, some unknown number of optional arguments) the value and error will be yielded
* When the arity is zero nothing will be yielded
* For all other arities the error, value and the future will be yielded – this will work with blocks, but means that lambdas that don’t accept three arguments but have optional arguments (for example `|v, e=nil|`) will still be called with three arguments, and will then raise an error, which will be swallowed. This can’t be helped because I can’t find a way to distinguish between `|v, e=nil|` and `|v, e=nil, f=nil|`.
Expect only two arguments when using #on_complete

The interoperability interface will probably be two arguments, so it’s better to use this internally too. Unfortunately that also means we need to rely on checking for the presence of an error to determine state.

There are some more places where the state is checked explicitly with #resolved? and #failed? so there’s some more work to be done on interoperability.