Thousands of jobs are at risk after Halifax Bank of Scotland confirmed it is in advanced merger talks with Lloyds TSB.