Protecting a quantum state from environmental noise by an incompatible finite-time measurement