Protecting quantum entanglement by repetitive measurement