build: use Ubuntu 12.04 for linux gitian build

Work on #3533.

This successfully builds on Ubuntu 12.04. Also upgrades the miniupnpc and qrencode dependencies to the same versions as #3527.