In chronicling the making of “Girls,” Dunham’s memoir reveals the cost of moving from the freedom of independent filmmaking to the corporate demands of television.