US discount retailer Kmart has reported a second-quarter net profit, compared to a year-earlier net loss.