Spark Examples: Fix sparkkmeans procedure for invalid index

Return an appropriate message with error code for invalid index