Jean-Philippe Mateta scored twice to condemn West Ham boss Graham Potter to a first Premier League defeat as Crystal Palace won 2-0.