I ran into the situation recently myself and we underwrote according to FNMA regs. Yes, you can keep the HELOC open and re-subordinate to the new first lien.
For underwriting purposes, the HELOC will be counted against your overall Debt to Income ratio by allocating a 1% monthly liability based on the total loan committment for the HELOC. For example, if your HELOC limit is $50,000, then factor in a 1% monthly multiplier (50,000 x 1.00% = $500/month).
If your 'tight' already on your DTI ratio, then the HELOC might push you over the limit. Check with a local banker and disclose the HELOC, run your numbers and hopefully you still have enough room to make the refinance work.