Ringgit ends lower versus greenback