Loschmidt echo driven by hyperfine and electric-quadrupole interactions in nanoscale nuclear spin baths