fixed #390 - casper.start().wait(x, fn) makes test hang on fail