RunningTask.close() is now idempotent

This closes #895 by making `RunningTask.close()` idempotent. It also changes `RunningTask.close(byte[])` to throw an Exception when the Task is no longer in state `RUNNING`
Merge pull request #896 from Microsoft-CISL/weimer_895

RunningTask.close() is now idempotent