[osh] Make ${!ref} with invalid ref non-fatal (#2204)