fixed memory corruption on throw

Fixed a bug where the jump buffer was freed before the long jump could be
performed. This caused random memory corruption on a throw.
added exports, general fixes

Added missing export tags to threading and dynamic library functions. Fixed an
invalid macro when compiling without debug mode. Fixed a problem with OS paths
that would output garbage data. Fixed a mistake in the string accumulator
test, forgetting to intialize the length to zero. Corrected a bounds check for
expanding buffers for string accumulators.