Upgrading problem

Just because you have write access from the ftp user doesn’t mean that the user Apache/PHP is running in has write access.

I’d advise you upgrade manually, or check your write permissions and ownership for whichever user Apache is running as on those files.