Lattice anchoring stabilizes solution-processed semiconductors