In its battle for the top spot in the rocky PC industry, Hewlett-Packard has edged out rival Lenovo to take back its leadership position.