Fixed & Improved: better handling of file extensions

- now respect the case of extensions according to the operating system
- right gzip behavior about extensions: case-insensitive on any os.
  Extensions _z, -z, .z and .tar and .taz are handled
- right bzip2 behavior about extensions: case-sensitive according to the
  os. Extensions: .bz, .tbz, tbz2 are handled
Added: prevent closing file descriptors