bytes_cpy: avoid malloc and memcpy when size is zero