Samsung Electronics tips record second-quarter profit as memory prices surge