Implement msync().