Breaking of ensemble equivalence in networks