Differential role of microenvironment in microencapsulation for improved cell tolerance to stress