Apply alternative PathAndQuery parsing for Mono.
Add mono conditional for DllImport.