malloc/memalign: avoid integer overflow