Fix respecting remote_tmp when sudo is used