Pilot Co., which operates Pilot and Flying J travel centers and is owned by Berkshire Hathaway, agreed on Tuesday to take a stake in Kodiak Robotics Inc., a driverless truck startup.