Workers at Harland and Wolff shipbuilders narrowly accepted a pay offer that could throw a lifeline to the yard that built the Titanic, their union said.