Magnetism in undoped MgO studied by density functional theory