House extends surveillance powers after late-night revolt sinks GOP plan