update key change handlers

fixed potential crash if key changed before db opened
by moving the native code load into onCreate()