Formation of porous membranes for drug delivery systems