Fixes a bug with getting output metadata from BlockchainDB

Thanks to moneromooo-monero for spotting the bug.