Spain’s state-owned shipbuilder confirms it is buying Harland & Wolff, best known for the Titanic.