Fix race condition in external resource localization

Closes #60