Ouch - fix bad race condition in direct modex

cmr=v1.7.5:reviewer=hjelmn:subject=fix bad race condition in direct modex