g10: factor out a function for secret key retrieval.
* g10/export.c (receive_seckey_from_agent): New. (do_export_stream): Use it.
Also fixed a memory leak of WRAPPEDKEY on a successful path of
build_packet.
In the log message, key is now by a hexgrip instead of a format by
keystr_with_sub.