Apple and Samsung agree to mediation in latest patent battle