I've experienced a similar problem when I mounted CD from one program (mountapp in wmaker) and tried to unmount it from another program (xfe filemanager). Now I use only one program (mountapp) to both mount and unmount CD's and it seems to work fine.
If that doesn't help, you can install a special app for managing all your mounting/unmounting -- I'd suggest the xvmount program. Of course, Gnome and KDE might use some clever utilities to automatically mount/unmount CD's but I wouldn't know anything about these because I don't use Gnome or KDE.