The fix for bug 1675 introduced a regression. tdbio_set_dbname() calls
take_write_lock() before try_make_homedir(), but that tries to create the lock
in the homedir, which doesn't exist yet.
The error is:
"gpg: failed to create temporary file
`/home/ubuntu/.gnupg/.#lk0x21044c0.adt.7314': No such file or directory"
Seen with 1.4.20, but code in 2.x is similar.
See downstream bug report: