A closely-watched case where business titan Richard Liu was accused of rape was settled hours before trial.