check if _cb is set on "end"

otherwise, an error would lead to `null` being called

fixes #2