Effects of external stress field on the charge stability of nitrogen vacancy centers in diamond