Ensure job registered first before return. (#19307)
Ensure job registered first before return. (#19307)

## Why are these changes needed?
Before this PR, there is a race condition where:
- job register starts
- driver start to launch actor
- gcs register actor ===> crash
- job register ends

Actor registration should be forced to be after driver registration. This PR enforces that.

## Related issue number
Closes #19172 

ray-project/ray,ray-project/ray,ray-project/ray,ray-project/ray,ray-project/ray,ray-project/ray,ray-project/ray,ray-project/ray