Move SetRegisterValue() after ProcessUsedBys() so that we publish the result AsyncValue through register only after its last use in ProcessReadyKernel().
Move SetRegisterValue() after ProcessUsedBys() so that we publish the result
AsyncValue through register only after its last use in ProcessReadyKernel().

This CL also refactors ProcessUsedBys() so that we don't pay the runtime cost
on checking whether it is the pseudo kernel.

PiperOrigin-RevId: 347442199

tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime