solve "undefined method `each' for nil:NilClass" that appears sometimes

defined? returns true even if @on_complete is defined as nil, by changing line 42 as I suggested we ensure that we never enter in the each loop with a nil @on_complete
Add failing test for #65.
Merge pull request #65 from gnagno/master

solve "undefined method `each' for nil:NilClass" that appears sometimes