DIY chain Homebase has been sold by its owner Home Retail Group to Australian retail giant Wesfarmers for £340m.