Check exception code only if class ZipArchive exists

If is for example exception throwed when downloading tar archive on system without installed zip extension, PHP hangs on fatal error " Class 'ZipArchive' not found".
Merge pull request #2483 from JakubOnderka/patch-2

Check exception code only if class ZipArchive exists
Detect ~> misuse and suggest fix, fixes #2476