s3-perfcount: fix incorrect array length calculations