Use openafs style CopyOnWrite

The partial_CopyOnWrite contained a bug which was introduced by the
use of positional I/O. This bug could lead to data corruption.

I also put all OSD additions to the end to make diff with openafs original
code easier.