Issue 5359 - isDelegate should work for types and expressions.

http://d.puremagic.com/issues/show_bug.cgi?id=5359

Taken over from https://github.com/D-Programming-Language/phobos/pull/1164.