Stability of water ice under a porous nonvolatile layer: implications to the south polar layered deposits of Mars