Ameristar Casinos swings to second-quarter loss