Fix mounted media matching string generation.

It wasn't correctly handling things with more than one parent dir.