Implement swe_close() for memory cleanup.
This cleanup fixes #3.