Add failing test of child-returning-parent-promise pattern.

The reason this test fails with an exception is pretty subtle. First,
notice (or just take my word) that the test passes if the following line
is commented out:

    expect(parentPromise.isFulfilled()).toBe(true);

The failing behavior is induced because `isFulfilled` has side effects.
When `promise.isFulfilled()` is called, it calls `valueOf(promise)` to
shorten the promise chain, which can lead to a non-promise value being
assigned to the closure variable `value` in `promise.valueOf` (just to be
clear, I'm talking about the `value` variable that was declared in the
local scope of the `defer` function).

If a callback passed to nextTick in `promise.promiseDispatch` is currently
pending, it will fail when it fires (with an unfortunately short stack
trace), because `value.promiseDispatch` is no longer defined, because
`value` is no longer a promise.
Only shorten chain in valueOf if new value also isPromise.

This is the most conservative approach I could find to fix the test I
introduced in my previous commit.

Note that `valueOf` still returns the same value that it would have
returned in every case before this commit; it's just that `value` is held
back so that it can continue to behave as a promise in case a pending
nextTick callback tries to call `value.promiseDispatch`.