encoder: set m_totalFrameThreads at the same time as param->frameNumThreads
nal: greatly simplify NAL header generation, do not use TComOutputBitstream

This saves a malloc/free and a great deal of needless overhead