fix incorrect display of downloaded files in the build script

This was due to stdout not being flushed in 659a072fe6eb646523d8feba8147dbd6842cc417
ignore all warnings when building Qt for the Linux builds

We cannot do this for the local POSIX build as we don't know which
compiler-specific flags will disable it.
perform an in-place prefix build for Qt in the build script

This removes the need for installing the patched Qt.
add support for OS X in the build script

This was based on suggestions/feedback by @mn4367 and @npinchot
and fixes #1545
fix check for detection of installed packages on Debian

dpkg-query returns an exit code of 1 when a package is not installed,
which causes an error in the build script. Now, the full list of
packages is read and the desired packages are looked up in it which
should fix #1707
allow changing the location in which the chroot environments are created

Also document the fact they are created in /opt/wkhtmltopdf-build by
default, which was requested in #1713
prefer SUDO_USER over logname to find login for granting schroot access

SUDO_USER is reported to work more reliably in certain scenarios
(see #1713) and it can be overridden easily if running as root.
create the linux chroots under /var/chroot by default

This is a better location and more likely to have free disk space,
as /opt might be mounted with insufficient disk space (see #1713)
use gmake wherever it is available for the posix-local build

This is useful when the default make is not GNU make e.g on FreeBSD
update the installation instructions comprehensively
install debian-archive-keyring before creating the chroot environments

This is required on Ubuntu and validates that the Release signatures
are valid, and is already installed by default on Debian. Unfortunately,
there is no way we can do the same for Ubuntu as ubuntu-archive-keyring
is not yet present in the Debian stable release and the name differs
from the Ubuntu version (ubuntu-keyring vs ubuntu-archive-keyring).
improvements in building dependent libraries for Windows

In preparation for additional libraries being downloaded/compiled, a helper
function download_tarball was added and the downloading/extraction process
was made more robust in the build script.
remove dependency on libwinpthread-1.dll for the newer MinGW-w64 builds

Newer versions of MinGW-w64 introduce a dependency on it for threads
support, which is removed by passing the -static flag to the linker
and fixes #1723