Fix for: https://github.com/bitcoin/bitcoin/issues/2667

lockunspent will now validate all of the provided outputs are
both unspent and belong to the local wallet.

The operation is now also atomic.