Direct measurement of the W boson width