Disconnecting external display without unplugging - turning off monitor doesn't work
One option is to use SwtichResX 


  SwitchResX is the most advanced tool for Apple computers to take
  control of any screen connected to the Mac. No matter whether a
  MacBook Screen, an external monitor, a Retina display, a TV set or a
  beamer: SwitchResX can handle them all – if you want, straight from
  the menubar, a contextual menu or both. It's that easy!


It works as you need.