octave: apply different patches against head and stable

Fixes #1442

sorry, i didn't get a chance to test this patch. seems it will take a year to pull the repo from http://www.octave.org/hg/octave.

- the patch for head referenced by this pull request comes from #1442, per @schoeps, the patch worked for him.
- and the patch for stable is the one we are using, so it should be fine.