object: Only weak unref if GObject is still alive

The function disassociate_js_gobject() is currently unconditionally
removing the weak reference of the wrapped GObject. This is because
we were previously assuming that there was always a toggle ref, and
so we would never reach this code path after the wrapped GObject was
destroyed.

Turns out, with commit 0cc23474 it is now a regular case to call
this function after the GObject is finalized. When that happens, it
will reach wrapped_gobj_dispose_notify() and the wrapped GObject will
be marked as finalized. disassociate_js_gobject(), however, will try
to weak unref it, without checking if the GObject was finalized already.

This commit fix that by simply checking if the wrapped GObject was
finalized before trying to weak unref it.
11 jobs for gbsneto/weak-ref-warning in 38 minutes and 56 seconds (queued for 24 seconds)
Status Job ID Name Coverage
  Source Check
passed #25383
cppcheck

00:02:14

passed #25384
cpplint

00:02:29

passed #25385
eslint

00:03:44

passed #25382
fedora

00:07:45

 
  Test
passed #25386
fedora_clang

00:09:11

 
  Thorough Tests
passed #25389
coverage

00:21:18

67.5%
passed #25388
installed_tests

00:03:22

manual #25392
allowed to fail manual
no_graphics
passed #25387
no_profiler

00:02:10

passed #25390
sanitizer_gcc

00:04:25

manual #25391
allowed to fail manual
valgrind