Voters in Ecuador have rejected the proposed return of foreign military bases, including ones operated by the United States.