Driver who hit Sydney pedestrians had not slept for days after taking ice, court hears