Fix incorrect read/write handling in "object_store.py".
When using C stdio library, the stream must be flushed or repositioned before
switching from write operations to read operations or vv. This applies to
CPython as well since "File objects are implemented using C’s stdio package".
http://docs.python.org/library/stdtypes.html#file-objects
See also http://bugs.python.org/issue3207.
DiskObjectStore._complete_thin_pack() didn't follow these rules which made the
test
dulwich.tests.test_object_store.DiskObjectStoreTests:test_add_thin_pack
fail with
IOError: [Errno 0] Error
on Windows.