Inconsistent allocation with threads and function arguments in 1.12

Maybe this is related and a workaround: