Eliminate race in merge_subtiles_by_key_closure.

Fixes #327