US grocer and distributor Spartan Stores has posted a rise in second-quarter sales and profits.