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
Merged-In: Ie74ad2160a7b265e12fe490aa96fccda52379949
(cherry picked from commit bda163d9c8313f0b92046abda5ffb1216af1e808)
4 files changed