Merge "base: allow creating tempfile in a custom temporary dir." am: 665f144566
am: d773ceb28a

Change-Id: I28c8921cb9c1ee3be00a2dddc3048697e184cff4