Record number of nurses quit NHS, analysis reveals