This article is from the comp.sys.acorn FAQ, by Paul Vigay with numerous contributions by others.
With v1.87 of the controlling software if you choose 'Direct Serial', to enable the serial port under the emulator, and then quit the emulator it doesn't correctly release the serial port back to RISC OS. However a temporary patch is to uncomment the very last line of the !PC486.!Run file.
Run <Diva$Dir>.!RunImage |uncomment the next line if you need to use the serial port after using !PC | RMreinit SerialDeviceDriver
Namely uncomment the RMreinit SerialDeviceDriver so that the above looks more like this.
Run <Diva$Dir>.!RunImage |uncomment the next line if you need to use the serial port after using !PC RMreinit SerialDeviceDriver
Then you should find control of the serial port returned to RISC OS after you have finished with the emulator. As of v1.91 this has been fixed and the serial port will be released properly. The latest version can be obtained from the Aleph1 FTP site.