fix issue 4995 - invariant() can violate a function's nothrow

http://d.puremagic.com/issues/show_bug.cgi?id=4995