Merge "Add extra checks around the profile file descriptor." into pi-dev
am: 2df6aa4178

Change-Id: Ibe5118538ab78dbe3cd390387359fd8af267854e