We study with a 3D PIC simulation discontinuities between an electron-positron pair plasma and magnetized electrons and protons. A pair plasma is injected at one simulation boundary with a speed 0.6$c$ along its normal. It expands into an electron-proton plasma and a magnetic field that points orthogonally to the injection direction. Diamagnetic currents expel the magnetic field from within the pair plasma and pile it up in front of it. It pushes electrons, which induces an electric field pulse ahead of the magnetic one. This initial electromagnetic pulse (EMP) confines the pair plasma magnetically and accelerates protons electrically. The fast flow of the injected pair plasma across the protons behind the initial EMP triggers the filamentation instability. Some electrons and positrons cross the injection boundary and build up a second EMP. Electron-cyclotron drift instabilities perturb the plasma ahead of both EMPs seeding a Rayleigh-Taylor-type instability. Despite equally strong perturbations ahead of both EMPs, the second EMP is much more stable than the initial one. We attribute the rapid collapse of the initial EMP to the filamentation instability, which perturbed the plasma behind it. The Rayleigh-Taylor-type instability transforms the planar EMPs into transition layers, in which magnetic flux ropes and electrostatic forces due to uneven numbers of electrons and positrons slow down and compress the pair plasma and accelerate protons. In our simulation, the expansion speed of the pair cloud decreased by about an order of magnitude and its density increased by the same factor. Its small thickness implies that it is capable of separating a relativistic pair outflow from an electron-proton plasma, which is essential for collimating relativistic jets of pair plasma in collisionless astrophysical plasma.