To be sure that RPi is shut down, open terminal program and type:
sudo shutdown -h now
Command will close all programs and communications, RPi will shutdown and your PC will say something like "connection is lost".
This command can be automated via scripts, links, etc.