virttest: Update the method to get test case name in write_subtests_files

We have some subtest name include "-". And the original method will use
the last word in the test case name as the whole case name in the subtest.cfg.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>