Vibrational properties of straight dislocations in bcc and fcc metals within the harmonic approximation