A pro-$p$ version of Sela's accessibility and Poincar\'e duality pro-$p$ groups