Spatial confinement induces hairpins in nicked circular DNA