Make bisection algorithm in chebfun.inv() work for decreasing functions.

This closes #1098.