On the dynamic programming approach for optimal control problems of PDE's with age structure