I don't think there is a way to make this synchronization any more efficient, and if the memory was not returned after use, that would be a memory leak. So there doesn't appear to be a memory leak because the memory is being freed.
Also, you have to be careful to look at the correct metric to determine the memory usage because the .net Framework will not always release memory back to the OS when it is done with it. Most times it keep the memory but marks it as free for use.
The GetFileStream method increases the efficiency of writing the synchronization script to disk only, and won't help you with the synchronization. For instance, if you wantes to write the script to disk without using GetFileStream, you would first have to turn the execution block to a string which will be completely in memory, and then writing that string to disk. Using a FileStream, you can read small bits (512 bytes) and write each buffer to disk instead.
If you have any more questions, please let us know.