Add missing free of the old rootDirectory pointer in setRootDirectory to prevent
memory leaks when the function is called multiple times. Also set rootDirectory
to NULL via setRootDirectory after VM teardown in runFile to ensure the pointer
is properly cleared before program exit.
The constants buffer was not being cleared when the compiler finished,
causing a memory leak since ownership of constants is transferred to
the new function via wrenNewFunction. Added wrenValueBufferClear calls
in both freeCompiler and endCompiler to properly release the buffer.