Fix issues with C.UTF-8 on recent glibc
These patches have been applied in Ubuntu to solve https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/2052930
Note that this means that build-time tests are less useful since some of them are skipped, which is why I added the locale generation bit to the autopkgtests.