Deal is a financial lifeline for Rivian as automakers rethink strategies in a slowing EV market