fix Class.getInterfaces to return only declared interfaces

Previously, we returned all interfaces implemented directly or
indirectly, which did not match the JDK behavior.