Fix a bug in ffi-parse.lua...

Writing to the documentElement field was being ignored because it was
done after the Document metatable was already applied and is marked by
that metatable as readonly.

This commit restructures the code slightly so that the documentElement
field is written before setmetatable() is called.