A distance-limited sample of massive star-forming cores from the RMS survey