#16618: Make glob.glob match consistently across strings and bytes

Fixes handling of leading dots.

Patch by Serhiy Storchaka.