Enhanced optical and electrical stability of thermally carbonized porous silicon