Impact of uniaxial pressure on structural and magnetic phase transitions in electron-doped iron pnictides