Weighted‐density‐functional theory calculation of elastic constants for face‐centered‐cubic and body‐centered‐cubic hard‐sphere crystals