Set ErrorInfo in Marshal.GetHRForException

Marshal.GetHRForException had a MonoTODO because it needs to set
the errorinfo object so that exceptions get properly passed to
unmanaged code. Since not all managed exceptions have a corresponding
HR value but we might need to get to the original thrown exception
we implement a ManagedErrorInfo helper class that implements the
IErrorInfo interface but also stores the exception.

In GetExceptionForHR we check if the errorinfo we get is a
ManagedErrorInfo. If it is we return the exception stored in there
(if it converts to the same error code), otherwise we construct a new
exception.

Change-Id: Ib400636ee3caa54c9db8f41dbd40f15710024a63
Backport fix for xamarin bug 6708.

This fixes a bug in xbuild that prevented FieldWorks from building.  Other
bug fixes/enhancements are also backported in this changeset:
1) support for the OverwriteReadOnlyFiles attributes in the Copy task.
2) preserving the modification time of files in System.IO.File.Copy.
Both of these are needed for using xbuild to build FieldWorks (replacing
nant).
Fix Xamarin bug 7594.

@(DocFileItem) is an output of CoreCompile, not an input.  (This bug still
exists in the current sources in the mono git repository.)