Revert "Revert "Avoid work if context is no-op in ThreadContext.inherit()""

This reverts commit 59e15ed58a77a437379d58182db0ee780ea5130c.