compiler/extccomp: use getNimcacheDir for writing build instruction (#10772)
compiler/extccomp: use getNimcacheDir for writing build instruction (#10772)

`conf.nimcacheDir` might be empty during build, which results in the
json build instructions being generated in the current directory. This
commit fixes the problem by using getNimcacheDir, which generates a
valid nimcacheDir should it be empty.

Fixes #10768
dom96/Nim,dom96/Nim,dom96/Nim,dom96/Nim,dom96/Nim,dom96/Nim,dom96/Nim