BUG-632: supress unneeded round-trips to JNI

This fixes Java logic to not update keys which match.

Change-Id: I7ff22f74cb82066367e4bb77c319ab11eb97eb99
Signed-off-by: Robert Varga <rovarga@cisco.com>