Flux jumping and a bulk-to-granular transition in the magnetization of a compacted and sintered MgB2 superconductor