NBA's Magic hire Mosley as head coach