Additional checks in GetDirectBuffer{Address,Capacity}

Add checks that the buffer argument is non-null and is a j.n.Buffer
instance.

This matches the behaviour described in the JNI spec for both methods
based on RETURNS section commentary. The JNI spec comments for
parameters seem at odds since they say the buffer must not be null,
(but not MUST not be null :-).

Bug: 122025675
Test: art/tools/buildbot-build.sh --host && jni_internal_test
Change-Id: Ie74ad2160a7b265e12fe490aa96fccda52379949
4 files changed