Added better arch detection for i386

Relying on CMAKE_HOST_SYSTEM_PROCESSOR isn't entirely reliable: it
gives x86_64 in an i386 chroot, for instance.  It now also queries
perl's longsize and recognizes arch=i386 if longsize=4 but
CMAKE_HOST_SYSTEM_PROCESSOR reports x86_64.