tests/netgraph: Prebuild tests directory
(partially cherry picked from commit e8db04c38959c882fe17e7c2b26fbabe74f26311)