Foundation hospitals survive Labour revolt