fix broken Class.getDeclar{ed|ing}Classes implementations

classpath-common.h's getDeclaringClass was trying to look up
non-existing classes, which led to an abort, and I don't even know
what Class.getDeclaredClasses was trying to do, but it was ugly and
wrong.
Merge pull request #201 from dicej/declaring

fix broken Class.getDeclar{ed|ing}Classes implementations