[runtime] Move thread attaching to mono-threads from the io-layer.
[runtime] Implement GetCurrentThreadId () using mono-threads.
[runtime] Rename the MONO_GSHARING define to ENABLE_GSHAREDVT for consistency.
[runtime] Rename mono_thread_info_dettach () to mono_thread_info_detach ().
[System] Fixed an error in the implementation of System.Net.IPAddress.IsIPv6Teredo

The property was introduced with PR #870 but it missed to convert network byte order to host byte order, so the comparison
wasn't working correctly and the corresponding unit test failed. @marek-safar erroneously "fixed" the test in 27e07c7.

This is the corrected implementation and the original test now works as intended.
[runtime] Simplify _wapi_set_termination_details ().
Merge pull request #884 from akoeplinger/fix-ipv6-teredo

[System] Fixed an error in the implementation of System.Net.IPAddress.IsIPv6Teredo
[runtime] Move more thread attach code to mono-threads from io-layer.
Fix src and dest indexes in DispatcherOperation ctor

The source and the destination indexes are confused. The source index, which
is the second parameter, should be 0 and the destination index, which is the
fourth parameter, should be 1.
Dispatcher.PushFrame: clean references before return

The dispatcher did not clean references before returning, therefore
the second call to Dispatcher.Run() failed.
[runtime] Simplify the io-layer threading code a bit more.
Dispatcher: Run() can be used more than once

When Run() was invoked a second time, main_execution_frame had the Continue
flag set to false. So it did not work correctly.
Dispatcher should stop if Continue is false

If the dispatcher encounters that frame.Continue is false, it should return
immediately and do not try to execute anything. The unit test may be seen as
rather artificial, but the problem may happen in more realistic situations
when frames are unwound.
InvalidOperationException in Dispatcher.RunFrame

When a Dispatcher exits due to 'frame.Continue' being false, it does not
clear queue_bits. As result, the next run of the Dispatcher could try to
dequeue a non-existing dispatcher operation.
Dispatcher should process a higher-priority task

When a higher-priority tasked appeared in the dispatcher queue, the
dispatcher stopped processing of the current queue but moved to a low
priority queue instead of processing the most high priority queue.
Merge pull request #886 from dmpot/master

[WindowsBase]: 6 fixes to Dispatcher
[corlib] Throw correct exception when array::copy elements don't match
[corlib] Clean up array binary search argument checks
[corlib] Allow to use custom comparer when sorting null values.
[runtime] Applied patch from Frank Fuchs <fk.fuchs@googlemail.com>. Fix the windows build.