C# code for and an example using a custom SynchronizationContext that serializes threads running code run under the context's protection