Last-minute spending on back-to-school products provided a welcome lift to many retailers in August, helping the latest monthly sales results to come in ahead of expectations.