Revert "Remove size check that required a costly fstat()"

This reverts commit 2d4c0bd1e9b0ad0db32e4f3705fe67f657f57230.