Merge #11945: Improve BSD compatibility of contrib/install_db4.sh