Fix json building at exit by using the same check for bulk/testport as err()