Fix self-update permissions

This PR fixes some wrong assertions and allow user to run "self update" command when he has write permission on the file and not the directory.
Fixes:
- Does not attempt to write backup if the directory is not writable
- Does not asserts that the backup's directory is writable when you run a rollback (because nobody write in this directory when you rollback)
- Restore the original permissions after updating

Improve:
- Check if the localFilename **or** it directory is writable
  - Use rename strategy when the directory is writable
  - Use content replace when the file is writable
- Restore the localFilename permissions instead of using the user's defaults
You need permission on file when you change it content and you need directory permission when you rename or delete the file.
If you look at line https://github.com/jeremy-derusse/composer/blob/selfupdate-permissions/src/Composer/Command/SelfUpdateCommand.php#L183, Regarding the permissions on the file or the directory, I'll use a rename strategy or a replace content strategy.
(beware, I'm not sure it's the same on windows)
```
$ touch foo
$ chmod 000 foo 
$ ls -al
total 52
drwxr-xr-x  2 jderusse jderusse  4096 Dec 27 11:13 ./
drwxrwxrwt 27 root     root     45056 Dec 27 11:13 ../
----------  1 jderusse jderusse     0 Dec 27 11:13 foo
$ echo "helo" > foo
bash: foo: Permission denied
$ mv foo bar
$ ls -al
total 52
drwxr-xr-x  2 jderusse jderusse  4096 Dec 27 11:15 ./
drwxrwxrwt 27 root     root     45056 Dec 27 11:14 ../
----------  1 jderusse jderusse     0 Dec 27 11:13 bar
$ chmod 777 bar
$ chmod a-w .
$ ls -al
total 52
dr-xr-xr-x  2 jderusse jderusse  4096 Dec 27 11:15 .
drwxrwxrwt 27 root     root     45056 Dec 27 11:17 ..
-rwxrwxrwx  1 jderusse jderusse     0 Dec 27 11:13 bar
$ echo "helo" > bar
$ ls -al
total 56
dr-xr-xr-x  2 jderusse jderusse  4096 Dec 27 11:15 .
drwxrwxrwt 27 root     root     45056 Dec 27 11:19 ..
-rwxrwxrwx  1 jderusse jderusse     5 Dec 27 11:18 bar
$ mv bar foo
mv: cannot move ‘bar’ to ‘foo’: Permission denied
$ rm bar 
rm: cannot remove ‘bar’: Permission denied
```