Update KeyPair.java

Fix:
If a KeyPair was created from an existing PrivateKey the actual publicKey-field stayed null forever. Each time .getPublicKey() was called it recalculated the PublicKey.

Moved this code in the constructor where it belongs to.