make DeferredGenerator support returning Deferreds in end and error callbacks