“How is it any different than what Onan did?”
Abstention is not onanism.
Abstention to prevent conception is.