Report success after handling error fixes #6684

Left this unsquashed so you can see it as two separate commits:

first the unit test 
  - creates a mock `init-package-json` which just immediately cancels (using @iarna 's excellent `requireInject()` module, thanks!) 
  - calls init(), collecting log messages
  - asserts that log message should contain 'canceled' but not 'written successfully'

This fails when run in the npm@2.1.8 repository.

The fix is just to move the log message about writing after the error handler.  Writing the repro case was much harder than fixing the bug