do not overwrite file if there are some errors

If `stylish-haskell` is not fount, it will overwrite the file with the error message. This patch check the exit code of the call.