Sanitize directory paths and do not allow '..'

Archived files with '..' in the directory path might be used to escape
the directory being extracted into and overwrite arbitrary files.