Just a note that this is fixed upstream. There were a series of patches cleaning up up smime_keys. I think the relevant one for this bug was http://dev.mutt.org/hg/mutt/rev/577987ca2d02 but it probably won't apply outside of the series of commits.
-Kevin