Mark various functions as @safe.

Also mark util.array functions as @trusted.