storage: check for existing blocks only in mainchain

this solves a reorg issue when the node thinks the current chain head is already stored - and it is, but as a side-chain block. In that case it should still try to sort the block in the branch it belongs.

https://github.com/lian/bitcoin-ruby/issues/78