Fixed open_tarfile cleanup on Windows platform

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Related tickets | 
| License       | GNU GPL v3

On Windows platform the tar file is not delete on close because
it need to be close before removing the file (resource used).