Fix readahead memory leak

This verifies and fixes #16
this is a common trick, but please add a comment explaining it anyway