Well, at least you know what the problem is. Now it’s a matter of determining what is causing that blank line to be there. In any event as Andrew has mentioned, I would recommend creating a separate test blog, either on your PC or on your webhost (this would most closely match the environment your current blog is running under: OS, Apache, PHP, and MySQL versions).
For example, my test blog on my PC (Windows 7 Pro 64bit) was able to update to 3.8.1 just fine, but my production blog was failing due to an issue with the webhost’s server, which has since been corrected. I made a separate test blog (different sub-domain, directory, and database) on my host running version 3.8 to do all my testing with to get the update to work.