Only try to open file when needed in lein-version.

(This should fix the breaking tests.)