Fix Twig namespace registration with realpath for production compatibility
