CreateOwnIdentityWizardPage: Synchronize

Synchronize around usage of the OwnIdentity object because it is stored
in the database.
This is a workaround for the following issue:
https://bugs.freenetproject.org/view.php?id=6247
DeleteOwnIdentityWizardPage: Synchronize

Synchronize around usage of the OwnIdentity object because it is stored
in the database. Clone it so we can keep using it across multiple
functions - synchronizing across all of them wouldn't be possible as
they are being called from the unrelated outside web interface code.

This is a workaround for the following issue:
https://bugs.freenetproject.org/view.php?id=6247
EditOwnIdentityWizardPage: Synchronize

This is a workaround for the following issue:
https://bugs.freenetproject.org/view.php?id=6247

Synchronize around usage of the OwnIdentity object because it is stored
in the database and thus subject to 6247. Clone it so we can keep using
it across multiple functions - synchronizing across all of them wouldn't
be possible as they are being called from the unrelated outside web
interface code.

Notice: The synchronized() block in make() didn't make any sense and
thus is removed:
We there only read from the OwnIdentity OR write data which we received
via HTTP. We don't to any read-compute-write cycle, so it wouldn't
provide any coherency.
Add utility for allowing "assert(some_function() did not throw)"

Will be used by the following commits
TrustID: Add constructor which consumes two identity ID strings.

Will be used by the following commits.
WebOfTrust: Add getTrust(String trusterID, String trusteeID)
WebOfTrust: Add FIXME of optimizing getTrust() usage
IdentityPage: Use faster WebOfTrust.getTrust()

The internal database query only needs the IDs, not the Identity
objects.
IdentityPage: Synchronize

This is a workaround for the following issue:
https://bugs.freenetproject.org/view.php?id=6247

Synchronize around usage of the (Own)Identity objects because they are
stored in the database and thus subject to 6247.

Notice: The approach of clone()ing the "Identity identity" in the
constructor which we do for the OwnIdentity in the constructor
won't work for the Identity:
The "Identity identity" is passed to getGivenTrusts() /
getReceivedTrusts() in make(), and those functions use
it in database queries. For the database queries to work, the very
same Identity object needs to be used as was obtained from a previous
database query. Thus, we cannot clone.
So instead, we query the Identity in make(). We use an ErrorPage there
for dealing with UnknownIdentityException, since make() may not throw -
as opposed to the constructor. Its a better place to handle this here
instead of throwing it in the constructor anyway: Throwing it in the
constructor would signal the caller that the logged in OwnIdentity did
not exist anymore - which is wrong in case of the non-own "Identity
identity".
The OwnIdentity is not queried in make() but in the constructor as it
was already - for the same reason: We better query it in the constructor
so we can throw there to signal the caller to log out the user since the
backing OwnIdentity does not exist anymore.
IntroductionClient.solvePuzzle(): Don't force caller to do db queries

Do this by only requiring the IDs of the database objects as parameters,
not the objects themselves.
None of the callers did need the objects, so its a lot faster if we only
require their IDs.
IntroductionClient: Add TODO of throwing proper Exception types
IntroductionClient.getPuzzles(): Don't force caller to do db queries

Do this by only requiring the IDs of the database objects as parameters,
not the objects themselves.
None of the callers did need the objects, so its a lot faster if we only
require their IDs.

Notice: The addContentBox() in IntroduceIdentityPage is moved downwards
because ErrorPage.addToPage() doesn't support adding stuff inside a
content box.
IntroductionClient.getPuzzles(): Return clone()s for database safety

This is a workaround for the following issue:
https://bugs.freenetproject.org/view.php?id=6247

The function only has 2 callers, and already claims to not require
synchronization, so its better to make the function return clone()s
instead of adding synchronization to the callers.
IntroduceIdentityPage: Synchronize

This is a workaround for the following issue:
https://bugs.freenetproject.org/view.php?id=6247

Synchronize around usage of the OwnIdentity object because it is stored
in the database and thus subject to 6247. Clone it so we can keep using
it across multiple functions - synchronizing across all of them wouldn't
be possible as they are being called from the unrelated outside web
interface code.
KnownIdentitiesPage: Synchronize

This is a workaround for the following issue:
https://bugs.freenetproject.org/view.php?id=6247

Synchronize around usage of the OwnIdentity object because it is stored
in the database and thus subject to 6247. Clone it so we can keep using
it across multiple functions - synchronizing across all of them wouldn't
be possible as they are being called from the unrelated outside web
interface code.
Also synchronize around all the other database quering code as well.

Notice: The OwnIdentity is not queried in make...() but in the
constructor as it was already - for the same reason: We better query it
in the constructor so we can throw there to signal the caller to log out
the user since the backing OwnIdentity does not exist anymore.
LogInPage: Document why we synchronize

This commit would have added synchronization similar to the preceding
commits, but the LoginPage already contains the necessary
synchronization.
Thus, only add a comment which explains why it is there.
MyIdentityPagePage: Synchronize

This is a workaround for the following issue:
https://bugs.freenetproject.org/view.php?id=6247

Synchronize around usage of the OwnIdentity object because it is stored
in the database and thus subject to 6247. Clone it so we can keep using
it across multiple functions - synchronizing across all of them wouldn't
be possible as they are being called from the unrelated outside web
interface code.
Also synchronize around all the other database quering code as well:
Move it to the constructor so we only need to take the lock once.

Notice: The size() actually returns integers, not longs. The previous
code which used longs was wrong. Thus, use integers here.
StatisticsPage: Document why we synchronize

This commit would have added synchronization similar to the preceding
commits, but the StatisticsPage already contains the necessary
synchronization.
Thus, only add a comment which explains why it is there.
Class WebInterface: Synchronize

This is a workaround for the following issue:
https://bugs.freenetproject.org/view.php?id=6247

Synchronize around usage of OwnIdentity/IntroductionPuzzle objects
because they are stored in the database and thus subject to 6247.
Clone the puzzle so we can keep using it without synchronization.
FCPInterface: Remove obsolete comment

This was from the days when the if() two lines below not only checked
the insert URI for being null but also the request URI. Nowdays,
creation of an OwnIdentity from an URI only requires the insert URI, the
comment can be removed.