Write profile to a temporary file and rename it on close

The code to rename the file on close was added by c868425e2325cc76f0d, the code
to create it with the correct name was not.
Ensure the trace file is always closed when the interpreter is destroyed
Always increment the ordinal when re-opening a closed trace file
Add an explicit MY_CXT parameter for reopen_output_file
Re-open the output file in the parent on fork/thread spawn

This ensures any eval text used by the child is written in a completed file
ready for processing.
Four times three evals means a maximum of twelve samples, not eight
We can't rely on an exact number of samples in the test
Clarify what the Right Thing is
Return hex-encoded process id from the reader

Also, fix code assuming unsigned int is exacly 32 bits.
Fix crappy fragile test
Fix test that was depending on a BEGIN block in main being always sampled
Add flags set to true when metadata/sections changed in the current frame
Add option to set the max file size at import time
Add a method to merge a report into another
Record parent-child information while parsing profile files
Add class to incrementally aggregate profiles into multiple reports

Still missing a way to collect all partial reports in a single file for load
speed, but the functionality is mostly there.
Add an explicit close tag to mark the end of a sequence of split files

Will be used by the incremental report aggregator to discard intermediate
state for a "done" subprocess.
Move genealogy data to a separate __state__ subdirectory
Load genealogy data in merged_report()
One-line fix to update the processed ordinal after adding a profile file to the report

...plus all the test jiggery required for aggregation tests to pass.