jsapi-util-root: Use a union for mutually exclusive members

In GjsMaybeOwned<T> the JS::Heap<T> and JS::PersistentRooted<T>* members
are mutually exclusive. The m_rooted flag determines which one we are
using. Therefore, we can put the two in a union to save space.

The only thing we have to do is watch out when switching from one mode to
the other. When switching to rooted, we have to be careful to call the
destructor of JS::Heap, and when switching to unrooted we have to use
placement-new to construct a JS::Heap in the location of the union.

This reduces the size of ObjectInstance to 88 bytes on x86_64 (although
when the GjsMaybeOwned is in rooted mode, that is, the ObjectInstance is
in toggle ref mode and a GObject owns a reference to it, there are 32
"hidden" bytes allocated for the PersistentRooted.)
20 jobs for refactor-object-instance-part3 in 17 minutes and 23 seconds (queued for 8 seconds)
Status Job ID Name Coverage
  Source Check
passed #55392
cppcheck

00:00:32

passed #55393
cpplint

00:00:52

passed #55394
eslint

00:00:37

passed #55410
fedora

00:02:30

failed #55391
fedora

00:00:06

 
  Test
passed #55395
fedora_clang

00:04:56

 
  Thorough Tests
manual #55407
allowed to fail manual
armv8
passed #55398
coverage

00:02:15

manual #55402
allowed to fail manual
installed_tests
manual #55403
allowed to fail manual
lts
manual #55400
allowed to fail manual
no_graphics
manual #55401
allowed to fail manual
no_profiler
manual #55408
allowed to fail manual
ppc64le
passed #55396
sanitizer_gcc

00:03:54

manual #55399
allowed to fail manual
valgrind
passed #55397
with_logging

00:01:43

manual #55406
allowed to fail manual
zeal_11
manual #55404
allowed to fail manual
zeal_2
manual #55405
allowed to fail manual
zeal_4
 
  Delivery
manual #55409
allowed to fail manual
packaging