In handling some Coverity-found issues, I think we were propagating some
errors too eagerly.  Fix these, along with the trace logging added for tracking
down the cause.