Add a _validate_ks_template_path function in remote.py.

This function was mistakenly not imported in merge #966.
This also fixes issue #1156.