source-archive: Close in use files before removing them (rebased)

Testing: Make sure "ant release" works on Linux/MacOS and Windows.