Ensures the FinishRoutine is only called once per instance

This fixes a crash where the HTTP server might close the client
connection during a transfer (via the chunkWriter for example) and might
call Close() again after completion, resulting in a crash:
    sync: negative WaitGroup counter