fix(resource.go): try writing to destination when rename fails

fixes #122