Gravothermal collapse of isolated self-interacting dark matter haloes: N-body simulation versus the fluid model