Love this idea! I'm not a coffee drinker - do you think instant coffee would work as well?
Unused coffee grounds are also great at getting rid of odors. Just make a little sachet ... tie a few tablespoons up in some nylon or cheesecloth (or any breathable type fabric...the more breathable the better) and close it up inside the bag for a week or so.
I've been able to completely get rid of musty smells, mothball odors, and even cigarette smoke this way. The bag will smell faintly like coffee for several days and then it will have really no odor at all.