/dev/stdout are the wrong device. These are not terminal devices, they're aliases for standard input and standard output respectively. Standard input and standard output are, by definition, file descriptors that applications expect to be open and have a conventional meaning (file descriptor 0 and 1 respectively, there's also 2 which is standard error). Devices such as
/dev/stdout are useful when an application requires a file name, but the user of the application wants it to access a particular file descriptor rather than opening some file. Depending on the unix variant, they might not even be device files; for example, on Linux, they're symbolic links to
/proc/self/fd/0 and friends, and these are in turn “magic” symbolic links to whatever file the process has already open on that file descriptor.
Changing the permissions of
/dev/stdout would only change what happens when these file names are used explicitly. It doesn't affect anything related to the terminal, and it doesn't affect normal use of standard input and standard output, since the permissions only matter when opening a particular filename.
mesg does is to change the permissions of the process's controlling terminal. For an application that's running in a terminal, the terminal is open on standard input, standard ouput and standard error (file descriptors 0, 1 and 2). You can use the command
tty to see what the terminal device is.
mesg n is equivalent to
chmod g-w "$(tty)" and
mesg y is equivalent to
chmod g+w "$(tty)".