Martingale theory for housekeeping heat