Maria Sharapova booked her place in the semi-finals of the Sony Open in Miami despite an unconvincing performance against Italy's Sara Errani.