Make Maildirs with square brackets work

The current released version of maildir fails with directories that contain square braces or other glob characters. This is a problem for Gmail over IMAP, which prefixes its special labels (All Mail, Drafts, Important, etc) with "[Gmail].".

I ran into this bug while using offlineimap to download my gmail account.