The U.S. Department of Treasury and the Internal Revenue Service issued guidance seeking to close a loophole that hedge-fund managers had been trying to exploit to avoid paying higher taxes on carried-interest profits.