testnode: fix performance issue when deleting pyc/pyo files