Understanding the locking behavior of msync