Power pin used as power in and power out
There are several solutions to this problem. The circuit you are looking for comes under several names, 


"OTG switch", like the FPF3042
"load switch", an example is FPF34892
As a last resort, use a "solid-state relay", example LBA710.


There are ICs that provide all three functions shown in your diagram, as the crazy-complicated LTC3576. I am sure Texas Instruments offers similar set of ICs. And many others.

So, possibilities are nearly unlimited.