Spontaneous polarization from first-principles: Pyroelectric BeO