Chipmaker Analog Devices to buy rival Maxim for about $21 billion