A struggling discount retailer has secured a last-minute rescue deal that could save hundreds of stores and thousands of jobs ...