Protecting entanglement via the quantum Zeno effect