imgprod: Close .img before passing it to objcopy
imgprod: Close .img before passing it to objcopy

This fixes a bug in the Windows port of newt.

Newt produces a .hex file by running `objcopy` on the .img file.  It was
doing this immediately after creating the .img file, before closing it.
In Windows, objcopy cannot open a file when it is already open by a
different process, so the command fails.

The fix is to close the .img file before executing objcopy.

apache/incubator-mynewt-newt,apache/incubator-mynewt-newt