function cloneMessage(msg) {
    if (typeof msg !== "undefined" && msg !== null) {
        // Temporary fix for #97
        // TODO: remove this http-node-specific fix somehow
        var req = msg.req;
        var res = msg.res;
        delete msg.req;
        delete msg.res;
        var m = clonedeep(msg);
        if (req) {
            m.req = req;
            msg.req = req;
        }
        if (res) {
            m.res = res;
            msg.res = res;
        }
        return m;
    }
    return msg;
}
Safely clones a message object. This handles msg.req/msg.res objects that must
not be cloned.

@param  {any}    msg - the message object to clone
@return {Object} the cloned message
@memberof @node-red/util_util