fix #52: segfault while downloading many files at the same time
Merge pull request #53 from LipuFei/fix_many_downloads

check for libevent buffer