Dephasing mechanisms of diamond-based nuclear-spin memories for quantum networks