Periodic trajectories with fixed energy on Riemannian and Lorentzian manifolds with boundary