fix callback not called when no data received

this fixes an issue where the callbacks were never called when no data is received e.g. during an empty directory listing.