lib/system: Don't modify dir parameter to pb_rmdir_recursive