Police officer stabbed in 'frenzied' machete attack