HSBC to pay $249 million to end foreclosure reviews