DisplayPort daemon (dpd) blocks sleep even when not in use
We frequently connect a MBP up to an iMac via a Thunderbolt port to use the larger display on the iMac. The Macs are switched into this more via Command-F2. When disconnecting Command-F2 is also used to complete the disconnect and return both Macs to normal display mode. The problem is that the DisplayPort Daemon is started by launchd when Command-F2 is initially pressed but does not shutdown dpd on exit. This causes the iMac to never sleep. Running "pmset -g" shows that dpd is the cause of the iMac not sleeping. Only a reboot will return the iMac to normal operation. We have used this procedure for at least ten years with success. This behavior is relatively new and started with Mojave.
I believe this is a Mojave bug since it does this on two different iMacs both running Mojave and has never done this in previous macOS releases.
iMac 27" 5K, 10.14