Update to make uploads in 4.0

In 4.0 the media uploads fail due to an issue with the cookies

See https://wordpress.org/support/topic/upload-fails-with-http-error?replies=9
Merge pull request #17 from loomtronic/master

Update to make uploads in 4.0 work correctly