Musharraf gets bail ahead of planned return