Sand production control by chemical consolidation