You could possibly address the pipe flex problem by either going with a heavier schedule (thicker) PVC pipe, or using a light weight metal. Of course, that will cost more. The other concern I would have is how tight / stable all those PVC fitting based moving joints will be. Maybe something based on conduit could work better.
I suspect you would be better served by picking out 2 positions in space for your keyboard... One for deployed (in use) and one for stowed (retracted), and then designing something with minimal pivot points that swings the keyboard from one position to the other. make it out of wood/metal and some creative use of stuff you can get at the hardware store [ You already show a flare for that.
You can probably get pretty good stability out of something that either limits how far a strong hinge unfolds, or lets you loosen & tighten a clamping handle / wingnut sort of thing.
Good luck with it!