Fix #22: create a copy of a task graph before exec

Before this change a task graph was modified according to the local execution
environment. Re-using the same graph results in wrong numbered connections.