High-pressure phase diagram of beryllium from ab initio free-energy calculations