Cause MenuDeactivate event to be delivered when appropriate

This is achieved by moving the FireMenuDeactivate call to
MenuStrip.Dismiss and causing it to be called in a couple of places
where it ought to be.
X11: improve handling of WS_EX_TOPMOST

Currently, WS_EX_TOPMOST is handled by making the window transient-for
the root window.  I was unable to find any documentation that indicated
that this would have the desired effect.  Instead, use SetTopmost to
set _NET_WM_STATE to _NET_WM_STATE_ABOVE, per EWMH.

Also, use XMapRaised to raise topmost windows to the top of the stack
when mapped, as a last ditch effort to support window managers that
do not respect _NET_WM_STATE, such as xmonad.

This fixes an issue I encountered when running a winforms application
in xmonad, whereby drop down menus would fail to re-open if windows
had been re-arranged after the menu was first opened (in reality,
the menu was hiding behind the form).
Ignore the gdiplus dllmap on Windows.
Fix Bug 4811, xbuild should find xml documentation
[System] Don't overwrite custom Connection header on HttpWebRequest
[System] Add crude (for now) socket stealing of an HttpWebRequest.

HttpWebRequest is a very tricky piece of code when it comes to its socket, this patch is more like a hack to get something working out of it but it's definitely not the best option.
[System] Implement a first pass of ClientWebSocket.
Improving the retrieval of the user's locale on Apple systems.

The previous behavior used the entire local identifier string that includes optional settings such as variant and calendar format. This returns locales like en_US_POSIX@calendar=buddhist which result in the user's culture being the invariant culture.

This change builds the locale from the language, country code and optional script code so that the locale returned is in the expected format.

This commit is licensed under MIT/X11.
Remove unneeded NetBSD code path from atomic.h.
Simplify the ifdeffery in atomic.c/.h a bit.
Use host preprocessor identifiers in atomic.c, not target.

Here we care about the system we run on, not the kind of
system that Mono is built to compile for.
Remove unneeded ARM code from atomic.c.
Use GCC atomics on s390x.
Remove MONO_ARCH_SAVE_REGS from threading icalls.
Kill the Cygwin hack in mono-membar.h.

We only support GCC 4.x in Cygwin now.
Use mono_memory_barrier () for Thread.MemoryBarrier ().

This gets rid of the rather hacky lock-based barrier.
Add implementations of various interlocked functions to atomic.c/.h.

Mainly 64-bit variants, but also InterlockedAdd ().
Add interlocked read/write functions to atomic.c/.h.

These are guaranteed to have sequential consistency regardless
of the bitness of the machine they run on.
Move definition of NEED_64BIT_CMPXCHG_FALLBACK to top of atomic.c.
Use __sync_sub_and_fetch () for atomic decrements for clarity.