Fix a memory leak

According to top, memory usage now stays low. Still slow compared standard
`sha1sum` executable.