added pwrite and pread, no more global locks