procfs: use dynamic_cast

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>