gjs-util: Fallback to default log handler in other threads

JavaScript functions can't be called from other threads, to prevent
this, store which thread the custom writer was originally set
from and then fallback to the default log writer if another thread
calls the handler. Also fallback to the default writer if the
custom writer returns UNHANDLED.

Fixes #481
22 jobs for ewlsh/fix-threading-with-logging in 3 minutes and 21 seconds (queued for 1 second)