Add @safe pure nothrow @nogc versions of dotProduct.

These are copies from the Phobos versions, with the extra attributes.
They should be removed once the Phobos versions have them as well.