[mono] Use DefaultDllSearchPaths attribute for PInvokes (#38975)
* [mono] Use DefaultDllSearchPaths attribute for PInvokes
So far we have been ignoring the flags contained in the attribute.
Attribute can be applied to a pinvoke method or an assembly. See https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.defaultdllimportsearchpathsattribute.-ctor?view=netcore-3.1#System_Runtime_InteropServices_DefaultDllImportSearchPathsAttribute__ctor_System_Runtime_InteropServices_DllImportSearchPath_
* Update src/mono/mono/metadata/native-library.c
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
* Minor fixes to comments and error handling
* Additional fixes
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Co-authored-by: Ryan Lucia <rylucia@microsoft.com>