fix heap corruption bug in memalign