Fix #17, ensure the keyfile is writable before creating a user