fix saving of key with a NUL character at the end #652

Just chop off the last character as long as it's a NUL.

fixes #652
Merge branch 'bugfixes/tokumx-1.3' into releases/tokumx-1.3