On an indictment for felony, the jury may find the accused not guilty of the felony, but guilty of an attempt to commit such felony; and a general verdict of not guilty upon such indictment shall be a bar to a subsequent prosecution for an attempt to commit such felony.