Optimizing and avoiding NPE in RowId and ReadOnlyRowId toString(#10410).

Change-Id: I6f16b9c55f661f5f75628ff627a01f8ec35e714e