Fix GetDirectBufferCapacity for zero length direct buffer

It is possible to create a direct buffer that has a null address and
zero size, e.g. mapping a FileChannel on a zero-length file. In this
case, GetDirectBufferCapacity() should return zero rather than -1.

Bug: 122025675
Test: art/test/run-test --host 2036-jni-filechannel
Test: art/test.py --target -r -t 2036-jni-filechannel
Test: art_runtime_tests
Change-Id: If615025385a8dfad00d815da128dfde19d2ddbc2
9 files changed