memctx: create a filectxfn if it is not callable
This will allow future patches to construct a memctx based on another context
or any other store-type object.
Testing that hghave does not crash when checking features $ "$TESTDIR/hghave" --test-features 2>/dev/null