Add exception guard for constructor vector(n, x, a) (#113086)

Added exception guard to the `vector(n, x, a)` constructor to enhance
exception safety. This change ensures that the `vector(n, x, a)`
constructor is consistent with other constructors, such as `vector(n)`,
`vector(n, x)`, `vector(n, a)`, in terms of exception safety.

GitOrigin-RevId: d3b98559be72682da45df73522173cb315912f6f
2 files changed