atomic.rb: Stop messing with file owner and mode.

As I understand this line was added deliberately to 'atomic.rb',
https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/file/atomic.rb#L39:
chown(old_stat.uid, old_stat.gid, file_name)

However, this is useless. A non-superuser user cannot change the
owning user and group of the file, unless it chown's them to itself,
in which case the chown is pointless to begin with. This was already
pointed out by David Burry but just in case, a demonstration:
$ touch  test-file
$ ls -lah test-file
-rw-r--r--  1 daenney  staff     0B 16 okt 13:22 test-file
$  chown nobody:nogroup test-file
chown: test-file: Operation not permitted

Even when the file is chmod'ed 0777 this does not work:
$ chmod 0777 test-file
$ ls -lah test-file
-rwxrwxrwx  1 daenney  staff  0 16 okt 13:22 test-file
$ chown nobody:nogroup test-file
chown: test-file: Operation not permitted

The only case this works is:
$ ls -lah test-file
-rw-r--r--  1 daenney  staff     0B 16 okt 13:22 test-file
$ chown daenney:staff test-file
$ ls -lah test-file
-rw-r--r--  1 daenney  staff     0B 16 okt 13:22 test-file

The only thing the chown in 'atomic.rb' manages to do is either change
the file to the already owning user and group or throw a permission error,
unless it's being run as root (and I really hope it isn't).

Michael Koziarski already responded once to this issue with this:
This line was added deliberately. Prior to its inclusion the files had the
ownership and group information of the file returned by Tempfile, which
was almost always wrong (e.g. the www-data user couldn't read it).

Now, that's all fine and dandy but this doesn't fly. If the user and group the
file was created with (as returned by Tempfile) are not identical to the user
and group you want to chown to this still won't work, unless you're running as root.

As also pointed out by chown's manpage:
For obvious security reasons, the ownership of a file may only be altered by
a super-user. Similarly, only a member of a group can change a file's group ID to
that group.

Now unless someone has sprinkled some wicked black magic inside Ruby's chown implementation
you still can't chown a file as non-root to something else than what it already is, unless
you already are the owning user and member of the owning group.

I still don't understand what this line was meant to achieve because as far as I can see,
this just won't work. Either you'll never hit a permissions error because you're running as
root or the owning user and group are already correct, otherwise this will blow up.

There's another issue, a SELinux or AppArmor policy can easily prevent
you doing anything like this in which case you'll again be hit with
permission errors or policy violations.

There's also an issue with the chmod the line below,
https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/file/atomic.rb#L40:
chmod(old_stat.mode, file_name)

A chmod is a 'destructive' operation, meaning that if filesystem ACL's were in play those
are now lost and your application might actually run in more problems than without the chown
because it was dependant on that ACL to actually be able to read the file.

Since 'atomic.rb' has no knowledge of the filesystem and how it was designed permission-wise
by the operator is shouldn't just go around trying to change file mode and ownership in the
hopes of fixing something automagically.

This commit removes the two lines in 'atomic.rb' which mess around with
file ownership and mode. At least the behaviour now is consistent and
predictable.