Fix concurrency bug when writing non-aligned data.
Currently, clients attempting to concurrently write two (non-overlapping) buffers may end-up overwriting each others changes if one of the buffers is non-aligned. This commit fixes the issue by always locking objects for mutation.
It also removes an accidental double-fetching of the object during read-modify-write.