Doctors wrongly predict how long terminally ill patients will survive in half of cases, new analysis claims.