Fixed setaccount accepting foreign address

Fixed issue https://github.com/bitcoin/bitcoin/issues/4209 where using setaccount with a foreign address causes the address to be added to your receiving addresses.
You're on the right track. However IMO you should do the ismine check before the code above here, to make sure the "Detect when changing the account of an address that is the 'unused current key' of another account" isn't done either for a foreign address.
Also it'd be nice to throw an error `throw JSONRPCError(...)`, instead of silently failing.