Samsung Electronics Co.’s $8 billion agreement to buy Harman International Industries Inc. helped breathe some life into a few moribund auto stocks, especially Visteon Corp., as investors speculate that there could be a buying spree of companies that make technology for self-driving cars.