build - Fix handling of MACHINE_PLATFORM

* Generate MACHINE_PLATFORM from sysctl -n hw.platform, bmake does not
  generate a default for this (it's DragonFly-specific).

* Fixes manual module builds e.g. building from the source dir instead of
  as part of a kernel build.
Unignore some files already present in repository
ioapic/i386: Allow GSI > 191
Merge branch 'master' into gsocdrm_github
libfetch: Fix PROXY_HOST bug, socket leak, cache-crash

As described in FreeBSD PR kern/139751, NO_PROXY=localhost doesn't work
due to bad for loop count.

As described in FreeBSD PR kern/153748, an ftp-cached connection will
close the connection too early when trying to send a request.

There is a socket leak in ftp_request that occurs after a connection is
established.  Make sure socket is disconnected before exiting.

Taken-From: FreeBSD SVN 198339 (21 OCT 2009)
Taken-From: FreeBSD SVN 199801 (25 NOV 2009)
Taken-From: FreeBSD SVN 217505 (17 JAN 2011)
libfetch: Fix hang due to SSL server closing before read completes

If the server sends a close notification before before a SSL read
operation is complete, fetch will hang.  Fix this by reworking
fetch_read() to use non-blocking sockets.

Taken-From: FreeBSD SVN 210568 (28 JUL 2010)
Taken-From: FreeBSD SVN 214256 (23 OCT 2010)
libfetch: Mark all socket and file descriptors close-on-exec

This allows libfetch to close cached sockets.
Also add cast that helped FreeBSD move warns to 6

Taken-from: FreeBSD SVN 221822 (12 May 2011)
Taken-from: FreeBSD SVN 221830 (13 May 2011)
libfetch: Fix failure to return to caller on error

As described in FreeBSD PR kern/171187, several error conditions were
missing return statements.

Taken-from: FreeBSD SVN 240595
libfetch: Support percent-encoded user and password

RFC 1738 specifies that any ":", "@", or "/" within a user name or
password in a URL is percent-encoded, to avoid ambiguity with the use
of those characters as URL component separators.

Taken-From: FreeBSD SVN 234138 (12 APR 2012)
libfetch: Change maximum redirect from 5 to 20

Libfetch gives up a little too soon.  Chrome and Firefox allow 20
redirects with IE stops after 8.

Taken-from: FreeBSD SVN 241839 (21 OCT 2012)
fetch: Fix infinite loop on display progress

As reported by FreeBSD PR bin/153240, fetch can loop forever if it is
interrupted by a signal at just the right time.

Verbatim from FreeBSD SVN 230307 (18 JAN 2012):
Fix two issues related to the use of SIGINFO in fetch(1) to display
progress information.  The first is that fetch_read() (used in the HTTP
code but not the FTP code) can enter an infinite loop if it has previously
been interrupted by a signal.  The second is that when it is interrupted,
fetch_read() will discard any data it may have read up to that point.
Luckily, both bugs are extremely timing-sensitive and therefore difficult

to trigger.
Implement SO_NOSIGPIPE

The SO_NOSIGPIPE socket option allows a user process to mark a socket so
that the socket does not generate SIGPIPE, only EPIPE, when a write is
attempted after socket shutdown.

Regression test added: tools/regression/sockets/sigpipe
libfetch: Avoid SIGPIPE on network connections

To avoid unexpected process termination from SIGPIPE when writing to a
closed network connection, enable SO_NOSIGPIPE on all network connections.

The POSIX standard MSG_NOSIGNAL is not used since it requires modifying all
send calls to add this flag. This is particularly nasty for SSL connections.

Taken-from: FreeBSD SVN 236193 (28 May 2012)
Merge branch 'master' into gsocdrm_alter