Activist investor Elliott Investment Management is investing $1 billion in Pinterest Inc. to help fund the social media company’s years-long effort to buy back shares.