Fix Homebrew on OSX 10.9 Mavericks

Fix all known Homebrew issues on OSX 10.9 Mavericks (python, readline, zlib, etc.)
I can't find a single formula which doesn't build after applying these changes.

I created this combined PR because those two changes should probably stay together. Do you agree?

Fixes #20508 
Fixes #20435