Fix crash in ragged_cross where the ragged tensor input is invalid
@mihaimaruseac  @cantonios  PR has been updated with commits merged. Please take a look.
This PR tries to address the issue raised in #59114 where ragged_cross will crash when input is invalid.
    
This PR fixes #59114.
    
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>