Hurricane Beryl weakens to tropical storm after sweeping into Texas