Improve locating the Scheme environment resource NIF library

This change is required for testability.