Contrasting effects of historical contingency on phenotypic and genomic trajectories during a two-step evolution experiment with bacteria