Hurricane Ernesto weakens into tropical storm as it moves away from Bermuda over open waters