Improve inout substitution algorithm for function pointer and delegate types

[Issue 10758](http://d.puremagic.com/issues/show_bug.cgi?id=10758) - Unsound type checking for inout
[Issue 10761](http://d.puremagic.com/issues/show_bug.cgi?id=10761) - DMD crashes on unspecified inout matching

Fill a hole in type system for inout and nested function