dist: corner case to support VPATH builds in a subdirectory of srcdir

(cherry picked from commit 4fb9b7a40d1d375872421b9651db2f243959d572)
tests/embedded: improve version extraction

avoid troubles when the tarball name contains another instance of 'tar'

(cherry picked from commit 18fb7f99eea2917afc5efac31e3de3d04fe4504d)