A sparrow-sized flying dinosaur with wings resembling those of a bat has been unearthed by scientists.