The rules are the same as keeping rice, beans, or lentils: keep them in a container that the insects can't chew through, and do not allow them access. This means glass, thick plastic (not a bag), or metal. I would do my best to dry off the seeds to prevent mold growth, beforehand. Even laying them on a paper towel for 15-20 minutes should help.
If you have problems with mold, try using something like a canning jar and use fine cloth in place of the lid. It should keep bugs out and allow moisture to escape.
Refrigeration will greatly extend the life of your seeds; if bugs do not have a chance to lay eggs on them, and the seeds are sufficiently dry to prevent mold, they should refrigerate for months.
Freezing is also good idea, as this will kill any bug larvae and prevent microbial spoilage; I'd try freezing a small batch of seeds first to make sure the moisture doesn't split them open.