Fix chebmatrix cellfun

Closes #1016.

Edit: I accidentally branched off my chebpts2 branch. Please ensure that's reviewed first (or as part of this pull request).