Fix crash when doing hash check with missing index
Fix crash when doing hash check with missing index

Specifically, when fetching an application where the expected hash is
unknown, the hash is validated from the hex index; when the index is
available, the hash is fetched fine and later inserted in the lock file.

However, if the index is not available, the call would simply crash.
This patch fixes thing so that instead, the index is refreshed before
giving up and failing.

vladdu/rebar3,norton/rebar3,rebar/rebar3,benoitc/rebar3,djnym/rebar3,erlang/rebar3,benoitc/rebar3,saleyn/rebar3,tsloughter/rebar3,rebar/rebar3,lrascao/rebar3,ferd/rebar3