Fix for "RuntimeError: No matching overloads found."

This fixes https://sourceforge.net/p/jpype/bugs/69/
The fix and the concept for the test code is from the patch attached to the bug written by an anonymous person on sourceforge.
Some other test fixes are in the pull request as well and are written by me.