virttest: Update the method to get test case name in write_subtests_file...

...s

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.