ByteBuffer: Fixed optimization failures with threading checks.