It has been predicted that superconducting junctions made with topological
nanowires hosting Majorana bound states (MBS) exhibit an anomalous
4\pi-periodic Josephson effect. Finding an experimental setup with these
unconventional properties poses, however, a serious challenge: for
finite-length wires, the equilibrium supercurrents are always 2\pi-periodic as
anticrossings of states with the same fermionic parity are possible. We show,
however, that the anomaly survives in the transient regime of the ac Josephson
effect. Transients are moreover protected against decay by quasiparticle
poisoning as a consequence of the quantum Zeno effect, which fixes the parity
of Majorana qubits. The resulting long-lived ac Josephson transients may be
effectively used to detect MBS.Comment: 9 pages, 4 figures, published version (with supplementary material