Replace os.exists with os.path.exists

Change-Id: I53bec3e74ddf501998f69cd8fc3f485794425be6
Closes-bug: 1272051