Fix client crashes when swapping parts quickly

Merging two machines on the client when swapping parts quickly could
cause crashes due to null TEs