Perform checks before thanking via API

If the user attempts to thank an anonymous
user, a bot (when $wgThanksSendToBots is not true),
or him/herself, return an error. This is consistent
with the restrictions imposed in insertThankLink().

Bug: 56954
Change-Id: I9e8ae030a8ff1cc312bf98671e593c7367ca0ea2