Effect of porosity on the adsorption, desorption, trapping, and release of volatile gases by amorphous solid water