Fix identity handling for inproc transport

Fixes #872

Backport of hurtonm/master@a09407829