Fix write logic so we can acutally write up to max_size
Fix write logic so we can acutally write up to max_size

Original git commit by Christian Kellner <gicmo@gnome.org> at 1177935442 +0200

svn path=/trunk/; revision=493

gicmo/gvfs,xkahn/gvfs-cmis,philipl/gvfs,cpatulea/gvfs,philipl/gvfs,cpatulea/gvfs,gicmo/gvfs,gicmo/gvfs,halfline/gvfs,halfline/gvfs,gicmo/gvfs,xkahn/gvfs-cmis,xkahn/gvfs-cmis,philipl/gvfs,halfline/gvfs,xkahn/gvfs-cmis,thiblahute/gvfs,thiblahute/gvfs