[osh] Improve bash compatibility for `${a@a}` and `${a[0]@A}` (#2208)