mesh: Fix dereferencing mod->pub too early
mesh: Fix dereferencing mod->pub too early

The bt_mesh_model_publish() is supposed to return a "not supported"
error if the publish context doesn't exist. Fixing the premature
dereferencing also fixes coverity warnings.

X-Original-Commit: 5c766168d16c53bd28b9b33003ce04d99066516d

apache/mynewt-nimble,apache/mynewt-nimble,apache/mynewt-nimble,apache/mynewt-nimble,apache/mynewt-nimble