Cosby in court as lawyers demand sex charge dropped