Move ScopedBytes into libcore/luni from libnativehelper

The ScopedBytes class is only used in libcore and we can make it more
efficient if it uses a JniConstant for primitive byte array.

Previously it could not use caching in libnativehelper because it was
part of a header-only library and the lack of caching showed primitive
byte array as a hot class due to use of ScopedBytes in libcore.

Bug: 168471625
Test: atest CtsLibcoreTestCases:libcore.android.system.OsTest
Test: m checkbuild
Change-Id: I3fb268481da73a527d083eb1122a2e7d20d4faa5
6 files changed