Disable proximity sensor when locked
Short answer

No, this is not possible with a standard installation of iOS.

Long answer

Yes, this is possible if your iPhone happens to be jailbroken. If so you can install software that allows you to create custom gestures. This is achieved through the installation of a couple of packages: Always on Proximity and Activator.

NOTE: This answer in no way supports or endorses jailbreaking your device.