Fix build on .net 4.0 (HResult is protected property).