Only set relation data if the shared-db hook actually configured something; this is not compatibility with juju-core
Merge juju-core compat. fix from James Page.