pb-c-rpc: check closures after client_failed callback

client_failed() in rig-protobuf-c-rpc.c would save off a pointer to the
closures associated with a client before calling an associated
error_handler callback and then dereference the saved pointer which
could have been invalidated in the error handler. This changes the code
to only check for closures after calling the error handler.
rig-rpc: don't sync destroyed GSource pollfds

After calling protobuf_c_dispatch_dispatch we always follow up by
calling sync_source to update the pollfd state but we weren't
considering that the dispatching may have destroyed the GSource and so
in that case we shouldn't try and synchronize its state.
asset: associate a RutContext with each asset

To be able to determine the full-path for an asset we need to know the
associated context so we can access the assets_location.
slave: pass RigData not RigSlave to rig_engine_paint

This fixes a bug in rig-slave.c where we were passing a RigSlave pointer
to rig_engine_paint instead of a RigData pointer.
slave: Adds support for sending serialized assets

Since slaves will be remote from the editor they can't just load assets
from disk like the editor so this adds support for streaming assets to
slaves and letting them load from memory instead of from disk.
Adds rig-device program

This adds a simple rig-device program that can run a given UI in device
mode without any editing or slave/remote preview capabilities.
pb-c-rpc: Adds rig_pb_rpc_client_add_connect_handler

This adds rig_pb_rpc_client_add_connect_handler api to let us register a
callback with a PB_RPC_Client that gets called when the client connects
to a server. This is much more convenient to use than having to poll the
connection status with rig_pb_rpc_client_is_connected. This change also
fixes a problem with the way we handled polling before that resulted in
us starving the mainloop after connecting an editor to a slave.
fix loading from .rig protocol buffer files

When refactoring the code for loading from protocol buffer format files
rig was no longer actually associating the loaded objects with the
engine itself it was simply unserializing them. This makes sure the
object then get associated with the core engine too.
rename RigData to RigEngine

This renames RigData to RigEngine and also renames main.c to
rig-engine.c and rig-data.h to rig-engine.h. This should make things
slightly clearer that it ideally only encapsulate the core UI rendering
engine state. To support the editor we should perhaps consider adding a
new RigEditor type that would internally reference a RigEngine.
pb: support [un]serializing camera components

This adds some new message types to rig.proto for encoding camera
components and adds support to rig-pb.c for serializing and
unserializing camera componens.
engine: split out ensure_light() from rig_engine_init

This splits out the code for ensuring there is a light for the scene,
that there is a camera associated with the light and if running as an
editor that there is a visual handle for the light.
engine: split more out or rig_engine_init

This splits out the code for creating the editor ui and some code for
creating a debug gradient texture from rig_engine_init. It also moves up
a few bits of initialization that don't depend on any ui having been
loaded.

The aim is to help clarify what parts of initialization relate to
loading a new document since we currently make some assumptions about
only loading a document at initialization time but there is code in
rig_engine_init that needs to be dealt with directly as part of document
loading instead.
engine: set light camera viewport

This makes sure we set the viewport of the light camera based on the
size of the shadow_fb framebuffer to make sure we render to the full
extents of the shadow_fb framebuffer.
refcount-debug: Don't call backtrace() with zero backtrace level

If RUT_BACKTRACE_LEVEL is zero then when logging a reference it would
call backtrace() with a zero size for the address array. This seems to
cause crashes for some people so we might as well try and avoid it.
box-layout: Fix the axis used for the ‘other’ preferred size

When the preferred size of the box layout is queried it was using the
same axis for the ‘other’ size as for the ‘main’ size. This was
causing the inspector to report the tallest property inspector as its
width which would make it very wide when an entity with a text
component was selected.