Be smarter about getting name of the charm under test

Get the charm name from metadata.yaml if possible, otherwise fall back to dir name. JUJU_TEST_CHARM can still be used to override.