I have been able to FIX my problem manually removing this .pid file:
/var/lib/dnf/rpmdb_lock.pid
it was empty, probably a result of some error or crash and it was never removed by dnf, failing as per stack trace above:
File "/usr/lib/python2.7/site-packages/dnf/lock.py", line 64, in _read_lock
return int(f.readline())
ValueError: invalid literal for int() with base 10: ''

Same problem (backtrace) here, probably happened after an unexpected reboot.
In my case the file /var/lib/dnf/rpmdb_lock.pid does not exist. Instead I found /var/cache/dnf/x86_64/21/metadata_lock.pid. After deleting this file (and running `# dnf clean expire-cache`, did that just to be sure metadata was not corrupted) dnf worked fine again.