Return number of bytes read/wrote to VMs

Note: RTCW returns bytes wrote to game and cgame VMs.
Fix QVM memset and memcpy return value

They were returning NULL, but should return first argument.