Convert Pattern and Matcher to use NativeAllocationRegistry

Avoid finalizer use, since already finalized objects may still
be accessed by other finalizers, causing native memory
corruption.

This should also improve memory tracking and deallocation
performance a bit.

Bug: 27887091
Change-Id: Ib1df6bcdacaf8eba622b67c10ac9ceb675067884
4 files changed