use API assert for supported 'write' actions

For MediaWiki 1.23+ extend the existing assertion, that the bot is logged in,
to cover all write operations.

Also add check that the AssertEdit extension is present before asserting
for MediaWiki versions 1.14 to 1.22.  Prior versions do not provide a
list of running extensions.

If the first operation to the site is a edit operation, before server
capabilities have been determined, do the assertion unconditionally
as the api module doesnt know check.  If the server doesnt understand
the assert, it will issue a warning but others behave properly.

Bug: 55068
Change-Id: I80971cde07651a042ef6472dc1a81cb4a1704742
Merge "use API assert for supported 'write' actions"