Fix issues in cbuff when building without threads with GCC