MLB agrees to sex harassment policy