rc: call getEstimatedPictureCost() from API thread, prevent race hazards
rc,weight: nits
remove sign compare warnings from TLibEncoder, cleanup SAO
frameencoder: fix for crash in frameencoder when AccessUnitDelimiter is on

The m_entropyCoder need to set the bitstream first before calling codeAUD,
otherwise a crash will happen.