Teekay to buy Spanish tanker company