Truncating resources-to-copy.txt if it already exists

To fix the problem described in https://github.com/CocoaPods/CocoaPods/issues/1087.