Fixes race condition when using the pagelocked staging area