Treaty-based foreign tax credit and net investment income tax