Ref T1191. Two changes here:
- Try to use the utf8mb4 character set. Fall back to utf8 if it's not available. This may be slightly worse for old MySQL, but is far, far easier than trying to keeep a cache around somewhere with availability information.
- Prepare to transition to utf8mb4. I'm just going to switch this over in the future. I considered trying to save the migration state in the environment somewhere, but it gets really, really messy because we have to inspect the migration state in order to build a connection object. There's also no advantage in the overwhelming majority of cases. We can do something more messy here eventually if it ends up being more complicated than I think.