fix memwrite so it can be run repeatedly
fix memwrite so it can be run repeatedly

chenm001/connectal,chenm001/connectal,csail-csg/connectal,cambridgehackers/connectal,hanw/connectal,hanw/connectal,8l/connectal,csail-csg/connectal,8l/connectal,cambridgehackers/connectal,hanw/connectal,cambridgehackers/connectal,hanw/connectal,csail-csg/connectal,hanw/connectal,cambridgehackers/connectal,csail-csg/connectal,chenm001/connectal,chenm001/connectal,chenm001/connectal,8l/connectal,csail-csg/connectal,8l/connectal,8l/connectal,cambridgehackers/connectal