Fix rare crash where module function is called from another task before module has completed loading.