Add heap profiling tests.

Fix a regression in prof_dump_ctx() due to an uninitized variable.  This
was caused by revision 4f37ef693e3d5903ce07dc0b61c0da320b35e3d9, so no
releases are affected.