fix issue 3451 - Python 3 support for Matlab bindings

This pull request adds Python 3 support to the Matlab bindings module, as requested in issue 3451: http://code.opencv.org/issues/3451.

The changes affect rst_parser.py in the java module. Please check with the Java maintainer that the changes have no side-effects.