Thermodynamics of precision in quantum nanomachines