Fix the arguments of sameTail and make sameHead and sameTail @safe

This pull request fixes the following issues of `std.array.sameHead` and `sameTail`:

* They should take `in T[]`, not `T[]`.
* They should work with -safe option.