Shaft sealing in pump and compressors