Fix Error handling for generator

A generator raising an exception will now correctly emit an `error` event.
This can be used in unit test as the error event is now binded between the generator and its run context. 
Make this if statement single line and always return when calling a callback (this will make sure nothing happens afterwards - simple precaution):

`if (!running) return done();`