Fix browser capabilities compatibility with ms.net by 1) Avoid issues with capabilities defined with same name, but diferent case. and 2) favor majorversion/minorversion capabilities, but fallback to majorver/minorver if not found, to preserve compatibility with previous versions.
See Reported Bug #4786 in bugzilla which this attempts to resolve (and seems to succesfully).

This is a one line change:  result = null; had to be set before going back to the 'retry' point in GetConnection..

This is/should-be safe because we had just disconnected result a few lines earlier.

Without this change, under certain conditions which would flag a retry, when it went to the retry point
it wouldn't reset 'result', and as a result the main loop at the top of the GetConnection() function would
be skipped (it has -- while (result == null) -- at the retry point, and it would always be not null when it reached
that on retry), after which point it would just continue to retry on the same result indefinitely, which would eventually
result in an exception being raised.
This is the addition of a quick and dirty NUnit test for Bug 4786

This bug was fixed in another commit/push by Robert Wilkens (me).
This NUnit test will fail without the patch (It will raise a
NullReferenceException from within mono), but with the patch for that
bug it will not raise an exception and the test will exit cleanly.

Please note, the top of this patch source sets up a temporary network
socket to listen to a port which pool.GetConnection() simply tries to connect
to.  No data is transfered so nothing needed to be done other than to
call Listen() on that socket which was bound to the port.  If the listen fails,
it means something else is listening already, which is fine, so we ignore
any excpetions from this part of the code (catch and ignore).
This is a minor change to earlier commit which removes a commented out
sql server that should not have been there.  It changes nothing functionally,
but the server is a temporary server, so referencing it didn't make sense.
Force disposal of Sqlite commands with using-statements in order to better isolate the unit tests.
Xamarin-5116: Fix pasting of text with upper-ASCII chars

Text copied to the clipboard by another app may contain
text in Latin-1 with upper-ASCII characters instead of
the UTF-8 encoding we expect.

Also fixed problem unescaping characters when they are
followed by more text.

Change-Id: Ib8d746d42c1d34dccf8ddbf8db28e1515952fe05
Unit test for bug Xamarin-4959

Because the clipboard is a shared resource between applications
it is possible that the test sometimes fails for wrong reasons
if another app manipulates the clipboard just at the right time.

Change-Id: I1a52b62d2958ece35c8927172d94ab6ccb3183b0
Xamarin-4959: Fix copy of clipboard data after app exits

Clipboard.SetDataObject allows to pass a copy parameter that
determines whether the data will be kept on the clipboard after
the app exits or not.

This patch implements this for X11 (or rather GTK).

Change-Id: If69e75239ea35432e44f32a8a5ba54f3fe1fb60a
Xamarin-4921: Fix Listbox.SelectedItem after adding sorted item

When we add an item to a sorted listbox the indices of the selected
items change and need to be updated.

Change-Id: Ia32849fe10480354835dcd48b37d326d612af04f
If Mono's configure script cannot determine the soname of libX11,
assume libX11.so.6

The old behaviour is to try a couple of folders to find libX11.so.4,
5, and 6, and if it can't find any of those, assume no soname at all
(i.e. libX11.so). It is reasonable to assume that users will be
running at least XFree86 3.0, so reasomable to assume libX11.so.6 will
be the soname in use.

The edge case "user compiles Mono without X.org installed" is much
more common than "user has X386 1.0 -> XFree86 2.1.1 installed in
a non-standard library folder, and expects a valid dllmap in
/etc/mono/config"
Improve type load errors thrown by the JIT a bit.
Merge pull request #301 from directhex/master

If Mono's configure script cannot determine the soname of libX11, assume libX11.so.6
[corlib] Fix ConcurrentStack.TryPopRange and add tests. Fix #5304
Merge pull request #296 from ermshiperete/5116

Xamarin-5116: Fix pasting of text with upper-ASCII chars
Merge pull request #297 from ermshiperete/4959

Xamarin-4959: Fix copy of clipboard data after app exits
Merge pull request #298 from ermshiperete/4921

Xamarin-4921: Fix Listbox.SelectedItem after adding sorted item
Merge pull request #289 from alaendle/master

Force disposal of Sqlite commands with using-statements in order to better isolate the unit tests.
Merge pull request #283 from robwilkens/master

Bug #4786- fix: Mono.Data.Tds.Protocol.TdsConnectionPool.GetConnection() needs to have result set to null before looping back with goto
Double <-> Int64 conversion is much faster now.

Instead of using GetBytes and converting bytes to long, which
involves allocation and deallocation of small temporary array, the
simple cpu register load is in fact done now. This results in
a much faster operation.
Merge pull request #271 from pruiz/xamarin-bug-4108

Fix for Xamarin's bug #4108 (BrowserCaps compatibility problem with MS.NET)