Small cleanup of NativeMethodEnvironment
Move constants for C-Api constants into separate header file

This makes it easier to remove the static global map we now keep and
track this in the shared state. This also moves copied / shared header
files between 1.8 and 1.9 C-Api into a separate header and copies them
for the different modes.

The mri_oop.h file was created staticly from the configure script. If
it's static anyway, we might as well copy it from a file instead of
having it all inline in configure.
Ensure reinitialization for auxiliary threads lock
Move C-API constants into shared state

This avoids having global data for C-API constants. It also makes it
easier to wrap changes to these structures with a lock, which causes
issues like #2138. This change therefore also adds that lock so the list
of globals isn't modified concurrently.

This also would improve future possibility of embedded, as long as
people don't stuff things into global variables. The latter case is
already problematic anyway for extensions, so this change doesn't make
this problem worse and improves by not having the global state.
Cleanup unused target VM
Ensure to reset the call frame before running finalizers

The finalizers can trigger a GC and could try to scan the old call frame
for the root vm that isn't valid anymore. Therefore we need to reset
that.
Ignore Fibers that have no more data

During GC in the finalizers we might encounter fibers that have already
been finalized and have the data cleaned up. We can just ignore these
when this happens.
Switch signal handler to use mutex and condition instead of pipes

This matches the way the finalizer thread is setup and also solves
inherent concurrency issues with using a pipe based solution here.
Setup C-Api constants after initialization is complete
Use explicit pausing around fork() for signal handler and finalizer

This prevents deadlocks in situations where fork() is called from
multiple threads. The problem is that it keeps spawning and killing
threads that causes deadlocks in for example starting the thread in
Thread::in_new_thread when the thread becomes GC dependent.

The tricky interaction here between GC dependent and the worker_lock
makes this solution much easier. We now define explicit pause points
where it's fine that we can fork because these auxiliary threads aren't
running any code at that point.

These with all previous commits fixes #2138. This issues not only
exposed the thread safety issue with the C-API constants but also caused
the deadlocks that this commit and previous changes to the signal
handler fixes.