Some fixes

   * Improve npm error catching (issue #24)
   * Manage patch with empty folder (issue #25)
   * Write readable json file (config and stack) 
   * Debug update-stack function (pb reported in irc)
I retrieve folder/file here : https://github.com/poupotte/cozy-controller/blob/master/server/lib/patch.coffee#L15, so I already know that it exists. Maybe I can check if it is a folder, normally there isn't file (except stack.json in /usr/local/cozy/apps) but I can test to be sure.